diff options
author | Nadrieril | 2020-04-09 23:09:47 +0100 |
---|---|---|
committer | Nadrieril | 2020-04-09 23:10:36 +0100 |
commit | da80ef06a91e3869cc3c1d4dbd07259c408ff490 (patch) | |
tree | 76c2406150a3c46d6b7281ca3503d1a859a25e3d /serde_dhall | |
parent | 96bc42f4d7aa6746658e2da3bf6a6125e275c231 (diff) |
Move Label escaping out of its Display impl
Diffstat (limited to '')
-rw-r--r-- | serde_dhall/tests/de.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/serde_dhall/tests/de.rs b/serde_dhall/tests/de.rs index a5c42fd..41b4080 100644 --- a/serde_dhall/tests/de.rs +++ b/serde_dhall/tests/de.rs @@ -60,6 +60,9 @@ fn test_de_typed() { #[test] fn test_de_untyped() { + use std::collections::BTreeMap; + use std::collections::HashMap; + fn parse<T: FromDhall>(s: &str) -> T { from_str(s).parse().unwrap() } @@ -70,7 +73,6 @@ fn test_de_untyped() { (1, "foo".to_owned(), 42) ); - use std::collections::HashMap; let mut expected_map = HashMap::new(); expected_map.insert("x".to_string(), 1); expected_map.insert("y".to_string(), 2); @@ -79,7 +81,17 @@ fn test_de_untyped() { expected_map ); - use std::collections::BTreeMap; + let mut expected_map = HashMap::new(); + expected_map.insert("if".to_string(), 1); + expected_map.insert("FOO_BAR".to_string(), 2); + expected_map.insert("baz-kux".to_string(), 3); + assert_eq!( + parse::<HashMap<String, usize>>( + "{ `if` = 1, FOO_BAR = 2, baz-kux = 3 }" + ), + expected_map + ); + let mut expected_map = BTreeMap::new(); expected_map.insert("x".to_string(), 1); expected_map.insert("y".to_string(), 2); |