Skip to content

Commit 58dd8d9

Browse files
committed
Add test for boolean keys in map
1 parent 8652bf2 commit 58dd8d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,14 @@ fn test_deny_non_finite_f64_key() {
20182018
assert!(serde_json::to_value(map).is_err());
20192019
}
20202020

2021+
#[test]
2022+
fn test_boolean_key() {
2023+
let map = treemap!(false => 0, true => 1);
2024+
let j = r#"{"false":0,"true":1}"#;
2025+
test_encode_ok(&[(&map, j)]);
2026+
test_parse_ok(vec![(j, map)]);
2027+
}
2028+
20212029
#[test]
20222030
fn test_borrowed_key() {
20232031
let map: BTreeMap<&str, ()> = from_str("{\"borrowed\":null}").unwrap();

0 commit comments

Comments
 (0)