Skip to content

Commit c80cf41

Browse files
committed
Add tests for json value array
This is added because of #145 to confirm whether the issue is valid or not. As the test succeeds, the issue is not valid. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent 424b261 commit c80cf41

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/file_json.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,24 @@ fn test_error_parse() {
8181
)
8282
);
8383
}
84+
85+
#[test]
86+
fn test_json_vec() {
87+
let c = Config::default()
88+
.merge(File::from_str(
89+
r#"
90+
{
91+
"WASTE": ["example_dir1", "example_dir2"]
92+
}
93+
"#,
94+
FileFormat::Json,
95+
))
96+
.unwrap()
97+
.clone();
98+
99+
let v = c.get_array("WASTE").unwrap();
100+
let mut vi = v.into_iter();
101+
assert_eq!(vi.next().unwrap().into_str().unwrap(), "example_dir1");
102+
assert_eq!(vi.next().unwrap().into_str().unwrap(), "example_dir2");
103+
assert!(vi.next().is_none());
104+
}

0 commit comments

Comments
 (0)