summaryrefslogtreecommitdiff
path: root/src/tests/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/mod.rs')
-rw-r--r--src/tests/mod.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/mod.rs b/src/tests/mod.rs
index 6c40f6f..b7f9d3a 100644
--- a/src/tests/mod.rs
+++ b/src/tests/mod.rs
@@ -70,4 +70,23 @@ bar.y = 6
let mut keys: Vec<_> = conf.keys().collect();
keys.sort();
assert_eq!(keys, ["a", "foo"]);
+
+ let conf = Configuration::load(
+ "<test configuration 2>",
+ "
+x = 5
+x.y = 6
+x.y.z = 7
+foo = 12
+bar = 16
+"
+ .as_bytes(),
+ )
+ .unwrap();
+ conf.get_int("foo").unwrap().unwrap();
+ conf.get_int("x").unwrap().unwrap();
+ conf.section("x.y").get_int("z").unwrap().unwrap();
+ let mut unread: Vec<&str> = conf.unread_keys().collect();
+ unread.sort();
+ assert_eq!(unread, ["bar", "x.y"]);
}