Skip to content

Commit

Permalink
Update test for TomlParser
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangdt84 authored and not-fl3 committed Jul 14, 2023
1 parent 90294fc commit 0517a26
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use nanoserde::TomlParser;
fn de_toml() {
let toml_str = r#"
[[array]]
name = "a"
# a
name = "a" #aasdf
[[array]]
name = "b"
name = "b#asdf"
data = 123
[[array]]
Expand All @@ -24,7 +25,7 @@ hmm = "b"
let toml = TomlParser::parse(toml_str).unwrap();

assert_eq!(toml["array"].arr()[0]["name"].str(), "a");
assert_eq!(toml["array"].arr()[1]["name"].str(), "b");
assert_eq!(toml["array"].arr()[1]["name"].str(), "b#asdf");
assert_eq!(toml["array"].arr()[1]["data"].num(), 123.);

assert_eq!(toml["other_array"].arr()[0]["hmm"].str(), "a");
Expand Down

0 comments on commit 0517a26

Please sign in to comment.