Skip to content

Commit 8f49874

Browse files
committed
adding failing test for repro of rust-cli#417 showcasing failure to parse key containing periods in yaml
1 parent f12b93f commit 8f49874

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/Settings.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ place:
1515
# For override tests
1616
FOO: FOO should be overridden
1717
bar: I am bar
18+
192.168.1.1: a string value

tests/file_yaml.rs

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ struct Settings {
2626
place: Place,
2727
#[serde(rename = "arr")]
2828
elements: Vec<String>,
29+
#[serde(rename = "192.168.1.1")]
30+
ip_key: String,
2931
}
3032

3133
fn make() -> Config {
@@ -35,6 +37,15 @@ fn make() -> Config {
3537
.unwrap()
3638
}
3739

40+
#[test]
41+
fn test_keys_with_periods_deserialize() {
42+
let c = make();
43+
44+
let s: Settings = c.try_deserialize().unwrap();
45+
46+
assert_eq!(s.ip_key, "a string value");
47+
}
48+
3849
#[test]
3950
fn test_file() {
4051
let c = make();

0 commit comments

Comments
 (0)