diff options
author | Joel Gallant <joel@joelgallant.me> | 2020-09-16 08:31:18 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 08:31:18 -0600 |
commit | 6c51d3b6b2dbe49d1b40fd0f0326b73f16357f72 (patch) | |
tree | ee483b62c1267492b74135ef5fd49a52439fbd7d /tests/errors.rs | |
parent | 05f6d42512ed3adcb64da26d33fee7643ea5ed1b (diff) | |
parent | 79f5254c3926431063d0b2d6ffbd8154984a22ef (diff) |
Merge pull request #151 from szarykott/win_tests
Fix paths in tests expectations for all platforms
Diffstat (limited to 'tests/errors.rs')
-rw-r--r-- | tests/errors.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/errors.rs b/tests/errors.rs index 5f4a1a5..3a626c7 100644 --- a/tests/errors.rs +++ b/tests/errors.rs @@ -6,6 +6,7 @@ extern crate config; extern crate serde_derive; use config::*; +use std::path::PathBuf; fn make() -> Config { let mut c = Config::default(); @@ -20,10 +21,12 @@ fn test_error_parse() { let mut c = Config::default(); let res = c.merge(File::new("tests/Settings-invalid", FileFormat::Toml)); + let path : PathBuf = ["tests", "Settings-invalid.toml"].iter().collect(); + assert!(res.is_err()); assert_eq!( res.unwrap_err().to_string(), - "failed to parse datetime for key `error` at line 2 column 9 in tests/Settings-invalid.toml".to_string() + format!("failed to parse datetime for key `error` at line 2 column 9 in {}", path.display()) ); } @@ -33,12 +36,12 @@ fn test_error_type() { let res = c.get::<bool>("boolean_s_parse"); + let path : PathBuf = ["tests", "Settings.toml"].iter().collect(); + assert!(res.is_err()); assert_eq!( res.unwrap_err().to_string(), - "invalid type: string \"fals\", expected a boolean for key \ - `boolean_s_parse` in tests/Settings.toml" - .to_string() + format!("invalid type: string \"fals\", expected a boolean for key `boolean_s_parse` in {}", path.display()) ); } |