summaryrefslogtreecommitdiffstats
path: root/tests/file_hjson.rs
diff options
context:
space:
mode:
authorJoel Gallant <joel@joelgallant.me>2020-09-16 08:31:18 -0600
committerGitHub <noreply@github.com>2020-09-16 08:31:18 -0600
commit6c51d3b6b2dbe49d1b40fd0f0326b73f16357f72 (patch)
treeee483b62c1267492b74135ef5fd49a52439fbd7d /tests/file_hjson.rs
parent05f6d42512ed3adcb64da26d33fee7643ea5ed1b (diff)
parent79f5254c3926431063d0b2d6ffbd8154984a22ef (diff)
Merge pull request #151 from szarykott/win_tests
Fix paths in tests expectations for all platforms
Diffstat (limited to 'tests/file_hjson.rs')
-rw-r--r--tests/file_hjson.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/file_hjson.rs b/tests/file_hjson.rs
index 086489b..70d7ca0 100644
--- a/tests/file_hjson.rs
+++ b/tests/file_hjson.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,9 +70,11 @@ fn test_error_parse() {
let mut c = Config::default();
let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Hjson));
+ let path : PathBuf = ["tests", "Settings-invalid.hjson"].iter().collect();
+
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- "Found a punctuator where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace) at line 4 column 1 in tests/Settings-invalid.hjson".to_string()
+ format!("Found a punctuator where a key name was expected (check your syntax or use quotes if the key name includes {{}}[],: or whitespace) at line 4 column 1 in {}", path.display())
);
}