summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRyan Leckey <ryan@launchbadge.com>2017-06-13 19:02:33 -0700
committerRyan Leckey <ryan@launchbadge.com>2017-06-13 19:02:33 -0700
commit01583791f785e2883dc19b92c8c97b5fd31af0b6 (patch)
treef8e8be182f269cf2bcda3921f06014cd9bd7cb27 /tests
parentd5d790b94ea041c8d490f05e2b493a360c9477ff (diff)
Ensure config keys are case insensitive
Diffstat (limited to 'tests')
-rw-r--r--tests/set.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/set.rs b/tests/set.rs
index a575138..e02814b 100644
--- a/tests/set.rs
+++ b/tests/set.rs
@@ -38,3 +38,19 @@ fn test_set_scalar_path() {
assert_eq!(c.get("place.favorite").ok(), Some(false));
assert_eq!(c.get("place.blocked").ok(), Some(true));
}
+
+#[test]
+fn test_set_capital() {
+ let mut c = Config::default();
+
+ c.set_default("tHiS", false).unwrap();
+ c.set("THAT", true).unwrap();
+ c.merge(File::from_str("{\"loGleVel\": 5}", FileFormat::Json)).unwrap();
+
+ assert_eq!(c.get("this").ok(), Some(false));
+ assert_eq!(c.get("ThIs").ok(), Some(false));
+ assert_eq!(c.get("that").ok(), Some(true));
+ assert_eq!(c.get("THAT").ok(), Some(true));
+ assert_eq!(c.get("logLevel").ok(), Some(5));
+ assert_eq!(c.get("loglevel").ok(), Some(5));
+}