Skip to content

Commit 4c11e78

Browse files
Add test showing Boolean yaml hash key fails to be parsed
1 parent cf3c014 commit 4c11e78

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/testsuite/file_yaml.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,22 @@ inner_vec:
358358
str!["Cannot parse Array([Integer(1), Integer(2)]) because it is an unsupported hash key type"]
359359
);
360360
}
361+
362+
#[test]
363+
fn test_yaml_parsing_bool_hash_fails() {
364+
let result = Config::builder()
365+
.add_source(File::from_str(
366+
r#"
367+
inner_bool:
368+
true: "bool true"
369+
false: "bool false"
370+
"#,
371+
FileFormat::Yaml,
372+
))
373+
.build();
374+
assert!(result.is_err());
375+
assert_data_eq!(
376+
result.unwrap_err().to_string(),
377+
str!["Cannot parse Boolean(true) because it is an unsupported hash key type"]
378+
);
379+
}

0 commit comments

Comments
 (0)