From da80ef06a91e3869cc3c1d4dbd07259c408ff490 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 9 Apr 2020 23:09:47 +0100 Subject: Move Label escaping out of its Display impl --- serde_dhall/tests/de.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'serde_dhall') 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(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::>( + "{ `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); -- cgit v1.2.3