diff options
Diffstat (limited to 'tests/file_yaml.rs')
-rw-r--r-- | tests/file_yaml.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/file_yaml.rs b/tests/file_yaml.rs index 85788c4..8f7814e 100644 --- a/tests/file_yaml.rs +++ b/tests/file_yaml.rs @@ -10,6 +10,7 @@ extern crate serde_derive; use config::*; use float_cmp::ApproxEqUlps; use std::collections::HashMap; +use std::path::PathBuf; #[derive(Debug, Deserialize)] struct Place { @@ -69,11 +70,12 @@ fn test_error_parse() { let mut c = Config::default(); let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Yaml)); + let path_with_extension : PathBuf = ["tests", "Settings-invalid.yaml"].iter().collect(); + assert!(res.is_err()); assert_eq!( res.unwrap_err().to_string(), - "while parsing a block mapping, did not find expected key at \ - line 2 column 1 in tests/Settings-invalid.yaml" - .to_string() + format!("while parsing a block mapping, did not find expected key at \ + line 2 column 1 in {}", path_with_extension.display()) ); } |