summaryrefslogtreecommitdiffstats
path: root/tests/merge.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/merge.rs')
-rw-r--r--tests/merge.rs26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/merge.rs b/tests/merge.rs
index 922ae31..93e2f39 100644
--- a/tests/merge.rs
+++ b/tests/merge.rs
@@ -3,7 +3,6 @@
extern crate config;
use config::*;
-use linked_hash_map::LinkedHashMap;
fn make() -> Config {
Config::builder()
@@ -21,15 +20,22 @@ fn test_merge() {
assert_eq!(c.get("production").ok(), Some(true));
assert_eq!(c.get("place.rating").ok(), Some(4.9));
- let m: LinkedHashMap<String, String> = c.get("place.creator").unwrap();
- assert_eq!(
- m.into_iter().collect::<Vec<(String, String)>>(),
- vec![
- ("name".to_string(), "Somebody New".to_string()),
- ("username".to_string(), "jsmith".to_string()),
- ("email".to_string(), "jsmith@localhost".to_string()),
- ]
- );
+ if cfg!(feature = "preserve_order") {
+ let m: MapImpl<String, String> = c.get("place.creator").unwrap();
+ assert_eq!(
+ m.into_iter().collect::<Vec<(String, String)>>(),
+ vec![
+ ("name".to_string(), "Somebody New".to_string()),
+ ("username".to_string(), "jsmith".to_string()),
+ ("email".to_string(), "jsmith@localhost".to_string()),
+ ]
+ );
+ } else {
+ assert_eq!(
+ c.get("place.creator.name").ok(),
+ Some("Somebody New".to_string())
+ );
+ }
}
#[test]