Skip to content

Commit

Permalink
Update adjacent enum non-roundtrip tests to match serde-rs/serde#2505 (
Browse files Browse the repository at this point in the history
…ron-rs#471)

Update adjacent enum non-roundtrip tests to match serde-rs/serde#2505
  • Loading branch information
juntyr committed Aug 15, 2023
1 parent 963bd35 commit 285fb1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/123_enum_representation.rs
Expand Up @@ -108,14 +108,14 @@ fn test_adjacently_a_ser() {
bar: 2,
different: Inner::Foo,
};
let e = "(type:\"VariantA\",content:(foo:1,bar:2,different:Foo))";
let e = "(type:VariantA,content:(foo:1,bar:2,different:Foo))";
test_ser(&v, e);
}

#[test]
fn test_adjacently_b_ser() {
let v = EnumStructAdjacently::VariantB { foo: 1, bar: 2 };
let e = "(type:\"VariantB\",content:(foo:1,bar:2))";
let e = "(type:VariantB,content:(foo:1,bar:2))";
test_ser(&v, e);
}

Expand Down Expand Up @@ -175,7 +175,7 @@ fn test_internally_b_de() {

#[test]
fn test_adjacently_a_de() {
let s = "(type:\"VariantA\",content:(foo:1,bar:2,different:Foo))";
let s = "(type:VariantA,content:(foo:1,bar:2,different:Foo))";
let e = EnumStructAdjacently::VariantA {
foo: 1,
bar: 2,
Expand All @@ -186,7 +186,7 @@ fn test_adjacently_a_de() {

#[test]
fn test_adjacently_b_de() {
let s = "(type:\"VariantB\",content:(foo:1,bar:2))";
let s = "(type:VariantB,content:(foo:1,bar:2))";
let e = EnumStructAdjacently::VariantB { foo: 1, bar: 2 };
test_de(s, e);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/207_adjacently_tagged_enum.rs
Expand Up @@ -14,7 +14,7 @@ fn test_adjacently_tagged() {

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

assert_eq!(ron_string, "(type:\"Index\",data:1)");
assert_eq!(ron_string, "(type:Index,data:1)");

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

Expand Down
4 changes: 2 additions & 2 deletions tests/393_serde_errors.rs
Expand Up @@ -188,13 +188,13 @@ fn test_adjacently_tagged_enum() {
// the enum as a struct

assert_eq!(
ron::from_str::<TestEnumAdjacent>("(type: \"StructVariant\", content: (d: 4))"),
ron::from_str::<TestEnumAdjacent>("(type: StructVariant, content: (d: 4))"),
Err(SpannedError {
code: Error::MissingStructField {
field: "a",
outer: Some(String::from("TestEnumAdjacent")),
},
position: Position { line: 1, col: 39 },
position: Position { line: 1, col: 37 },
})
);
}
Expand Down

0 comments on commit 285fb1f

Please sign in to comment.