We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b2ba76 commit 6ca539cCopy full SHA for 6ca539c
tests/testsuite/file_yaml.rs
@@ -382,3 +382,22 @@ inner_bool:
382
assert_eq!(config.inner_bool.get(&true).unwrap(), "bool true");
383
assert_eq!(config.inner_bool.get(&false).unwrap(), "bool false");
384
}
385
+
386
+#[test]
387
+fn test_yaml_parsing_float_hash() {
388
+ let result = Config::builder()
389
+ .add_source(File::from_str(
390
+ r#"
391
+inner_float:
392
+ 0.1: "float 0.1"
393
+ 0.2: "float 0.2"
394
+"#,
395
+ FileFormat::Yaml,
396
+ ))
397
+ .build();
398
+ assert!(result.is_err());
399
+ assert_data_eq!(
400
+ result.unwrap_err().to_string(),
401
+ str!["Cannot parse Real(\"0.1\") because it is an unsupported hash key type"]
402
+ );
403
+}
0 commit comments