From 58dd8d9b89ef72ebb7a510fc07ba207279649668 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 15 Aug 2023 09:49:25 -0700 Subject: [PATCH] Add test for boolean keys in map --- tests/test.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test.rs b/tests/test.rs index 8d9a5942a..83f1620be 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -2018,6 +2018,14 @@ fn test_deny_non_finite_f64_key() { assert!(serde_json::to_value(map).is_err()); } +#[test] +fn test_boolean_key() { + let map = treemap!(false => 0, true => 1); + let j = r#"{"false":0,"true":1}"#; + test_encode_ok(&[(&map, j)]); + test_parse_ok(vec![(j, map)]); +} + #[test] fn test_borrowed_key() { let map: BTreeMap<&str, ()> = from_str("{\"borrowed\":null}").unwrap();