summaryrefslogtreecommitdiffstats
path: root/tests/legacy/file_toml.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/legacy/file_toml.rs')
-rw-r--r--tests/legacy/file_toml.rs32
1 files changed, 19 insertions, 13 deletions
diff --git a/tests/legacy/file_toml.rs b/tests/legacy/file_toml.rs
index 24c590e..53310b4 100644
--- a/tests/legacy/file_toml.rs
+++ b/tests/legacy/file_toml.rs
@@ -4,7 +4,6 @@ extern crate config;
extern crate float_cmp;
extern crate serde;
-use linked_hash_map::LinkedHashMap;
use std::path::PathBuf;
use self::config::*;
@@ -19,7 +18,7 @@ struct Place {
favorite: bool,
telephone: Option<String>,
reviews: u64,
- creator: LinkedHashMap<String, Value>,
+ creator: MapImpl<String, Value>,
rating: Option<f32>,
}
@@ -68,17 +67,24 @@ fn test_file() {
assert_eq!(s.place.telephone, None);
assert_eq!(s.elements.len(), 10);
assert_eq!(s.elements[3], "4".to_string());
- assert_eq!(
- s.place
- .creator
- .into_iter()
- .collect::<Vec<(String, config::Value)>>(),
- vec![
- ("name".to_string(), "John Smith".into()),
- ("username".into(), "jsmith".into()),
- ("email".into(), "jsmith@localhost".into()),
- ]
- );
+ if cfg!(feature = "preserve_order") {
+ assert_eq!(
+ s.place
+ .creator
+ .into_iter()
+ .collect::<Vec<(String, config::Value)>>(),
+ vec![
+ ("name".to_string(), "John Smith".into()),
+ ("username".into(), "jsmith".into()),
+ ("email".into(), "jsmith@localhost".into()),
+ ]
+ );
+ } else {
+ assert_eq!(
+ s.place.creator["name"].clone().into_string().unwrap(),
+ "John Smith".to_string()
+ );
+ }
}
#[test]