Skip to content

Commit

Permalink
test(serde): Focus on string serialization first
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 13, 2023
1 parent e2a6a1c commit 2b7c34c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/toml/tests/testsuite/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ macro_rules! equivalent {
let toml = $toml;
let literal = $literal;

// In/out of Value is equivalent
println!("try_from");
assert_eq!(t!(Table::try_from(literal.clone())), toml);
println!("try_into");
assert_eq!(literal, t!(toml.clone().try_into()));

// Through a string equivalent
println!("to_string");
snapbox::assert_eq(t!(toml::to_string(&toml)), t!(toml::to_string(&literal)));
println!("literal, from_str(toml)");
assert_eq!(literal, t!(toml::from_str(&t!(toml::to_string(&toml)))));
println!("toml, from_str(toml)");
assert_eq!(toml, t!(toml::from_str(&t!(toml::to_string(&toml)))));

// In/out of Value is equivalent
println!("try_from");
assert_eq!(t!(Table::try_from(literal.clone())), toml);
println!("try_into");
assert_eq!(literal, t!(toml.clone().try_into()));
}};
}

Expand Down

0 comments on commit 2b7c34c

Please sign in to comment.