diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-03-26 17:40:32 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-03-26 17:40:32 +0100 |
commit | c80cf417fcb7134cf595b3889ddf4fdaac4fa790 (patch) | |
tree | ba023a11f997377b8d0bd6f69d1a86def5060108 /tests | |
parent | 424b261532ef92d6d9e1d9156c52e657bfa1a37a (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/file_json.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/file_json.rs b/tests/file_json.rs index 307312e..2c614e1 100644 --- a/tests/file_json.rs +++ b/tests/file_json.rs @@ -81,3 +81,24 @@ fn test_error_parse() { ) ); } + +#[test] +fn test_json_vec() { + let c = Config::default() + .merge(File::from_str( + r#" + { + "WASTE": ["example_dir1", "example_dir2"] + } + "#, + FileFormat::Json, + )) + .unwrap() + .clone(); + + let v = c.get_array("WASTE").unwrap(); + let mut vi = v.into_iter(); + assert_eq!(vi.next().unwrap().into_str().unwrap(), "example_dir1"); + assert_eq!(vi.next().unwrap().into_str().unwrap(), "example_dir2"); + assert!(vi.next().is_none()); +} |