summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/errors.rs12
-rw-r--r--tests/legacy/errors.rs13
2 files changed, 9 insertions, 16 deletions
diff --git a/tests/errors.rs b/tests/errors.rs
index 60f1121..856da4f 100644
--- a/tests/errors.rs
+++ b/tests/errors.rs
@@ -117,21 +117,17 @@ fn error_with_path() {
inner: Inner,
}
const CFG: &str = r#"
-inner:
- test: ABC
-"#;
+ inner.test = "ABC"
+ "#;
let e = Config::builder()
- .add_source(File::from_str(CFG, FileFormat::Yaml))
+ .add_source(File::from_str(CFG, FileFormat::Toml))
.build()
.unwrap()
.try_into::<Outer>()
.unwrap_err();
- if let ConfigError::Type {
- key: Some(path), ..
- } = e
- {
+ if let ConfigError::Type { key: Some(path), .. } = e {
assert_eq!(path, "inner.test");
} else {
panic!("Wrong error {:?}", e);
diff --git a/tests/legacy/errors.rs b/tests/legacy/errors.rs
index c0ce234..5ded0a8 100644
--- a/tests/legacy/errors.rs
+++ b/tests/legacy/errors.rs
@@ -113,18 +113,15 @@ fn error_with_path() {
struct Outer {
inner: Inner,
}
+
const CFG: &str = r#"
-inner:
- test: ABC
-"#;
+ inner.test = "ABC"
+ "#;
let mut cfg = Config::default();
- cfg.merge(File::from_str(CFG, FileFormat::Yaml)).unwrap();
+ cfg.merge(File::from_str(CFG, FileFormat::Toml)).unwrap();
let e = cfg.try_into::<Outer>().unwrap_err();
- if let ConfigError::Type {
- key: Some(path), ..
- } = e
- {
+ if let ConfigError::Type { key: Some(path), .. } = e {
assert_eq!(path, "inner.test");
} else {
panic!("Wrong error {:?}", e);