Skip to content

Commit d5a01dd

Browse files
authored
Update adjacent enum non-roundtrip tests to match serde-rs/serde#2505 (#471)
Update adjacent enum non-roundtrip tests to match serde-rs/serde#2505
1 parent f692c63 commit d5a01dd

4 files changed

+11
-11
lines changed

tests/123_enum_representation.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ fn test_adjacently_a_ser() {
108108
bar: 2,
109109
different: Inner::Foo,
110110
};
111-
let e = "(type:\"VariantA\",content:(foo:1,bar:2,different:Foo))";
111+
let e = "(type:VariantA,content:(foo:1,bar:2,different:Foo))";
112112
test_ser(&v, e);
113113
}
114114

115115
#[test]
116116
fn test_adjacently_b_ser() {
117117
let v = EnumStructAdjacently::VariantB { foo: 1, bar: 2 };
118-
let e = "(type:\"VariantB\",content:(foo:1,bar:2))";
118+
let e = "(type:VariantB,content:(foo:1,bar:2))";
119119
test_ser(&v, e);
120120
}
121121

@@ -175,7 +175,7 @@ fn test_internally_b_de() {
175175

176176
#[test]
177177
fn test_adjacently_a_de() {
178-
let s = "(type:\"VariantA\",content:(foo:1,bar:2,different:Foo))";
178+
let s = "(type:VariantA,content:(foo:1,bar:2,different:Foo))";
179179
let e = EnumStructAdjacently::VariantA {
180180
foo: 1,
181181
bar: 2,
@@ -186,7 +186,7 @@ fn test_adjacently_a_de() {
186186

187187
#[test]
188188
fn test_adjacently_b_de() {
189-
let s = "(type:\"VariantB\",content:(foo:1,bar:2))";
189+
let s = "(type:VariantB,content:(foo:1,bar:2))";
190190
let e = EnumStructAdjacently::VariantB { foo: 1, bar: 2 };
191191
test_de(s, e);
192192
}

tests/207_adjacently_tagged_enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn test_adjacently_tagged() {
1414

1515
let ron_string = to_string(&source).unwrap();
1616

17-
assert_eq!(ron_string, "(type:\"Index\",data:1)");
17+
assert_eq!(ron_string, "(type:Index,data:1)");
1818

1919
let deserialized = from_str::<TestEnum>(&ron_string).unwrap();
2020

tests/393_serde_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ fn test_adjacently_tagged_enum() {
188188
// the enum as a struct
189189

190190
assert_eq!(
191-
ron::from_str::<TestEnumAdjacent>("(type: \"StructVariant\", content: (d: 4))"),
191+
ron::from_str::<TestEnumAdjacent>("(type: StructVariant, content: (d: 4))"),
192192
Err(SpannedError {
193193
code: Error::MissingStructField {
194194
field: "a",
195195
outer: Some(String::from("TestEnumAdjacent")),
196196
},
197-
position: Position { line: 1, col: 39 },
197+
position: Position { line: 1, col: 37 },
198198
})
199199
);
200200
}

tests/449_tagged_enum.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn test_enum_in_adjacently_tagged_roundtrip() {
165165

166166
let ron = ron::to_string(&outer).unwrap();
167167

168-
assert_eq!(ron, "(tag:\"Variant\",c:(field:Unit))");
168+
assert_eq!(ron, "(tag:Variant,c:(field:Unit))");
169169

170170
let de = ron::from_str::<OuterEnumAdjacent>(&ron);
171171

@@ -178,7 +178,7 @@ fn test_enum_in_adjacently_tagged_roundtrip() {
178178

179179
let ron = ron::to_string(&outer).unwrap();
180180

181-
assert_eq!(ron, "(tag:\"Sum\",c:(field:Newtype(true),value:42))");
181+
assert_eq!(ron, "(tag:Sum,c:(field:Newtype(true),value:42))");
182182

183183
let de = ron::from_str::<OuterEnumAdjacent>(&ron);
184184

@@ -191,7 +191,7 @@ fn test_enum_in_adjacently_tagged_roundtrip() {
191191

192192
let ron = ron::to_string(&outer).unwrap();
193193

194-
assert_eq!(ron, "(tag:\"Sum\",c:(field:Tuple(true,24),value:42))");
194+
assert_eq!(ron, "(tag:Sum,c:(field:Tuple(true,24),value:42))");
195195

196196
let de = ron::from_str::<OuterEnumAdjacent>(&ron);
197197

@@ -204,7 +204,7 @@ fn test_enum_in_adjacently_tagged_roundtrip() {
204204

205205
let ron = ron::to_string(&outer).unwrap();
206206

207-
assert_eq!(ron, "(tag:\"Sum\",c:(field:Struct(field:'🦀'),value:42))");
207+
assert_eq!(ron, "(tag:Sum,c:(field:Struct(field:'🦀'),value:42))");
208208

209209
let de = ron::from_str::<OuterEnumAdjacent>(&ron);
210210

0 commit comments

Comments
 (0)