summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdkt13 <rdkt13@gmail.com>2020-09-07 23:37:59 +0200
committerrdkt13 <rdkt13@gmail.com>2020-09-07 23:37:59 +0200
commit79f5254c3926431063d0b2d6ffbd8154984a22ef (patch)
treeee483b62c1267492b74135ef5fd49a52439fbd7d
parent53b8bf74381dc292834a356e4a760755d64fc60e (diff)
Use `display` method on PathBuf in tests
-rw-r--r--tests/errors.rs4
-rw-r--r--tests/file_hjson.rs2
-rw-r--r--tests/file_ini.rs2
-rw-r--r--tests/file_json.rs2
-rw-r--r--tests/file_toml.rs2
-rw-r--r--tests/file_yaml.rs2
6 files changed, 7 insertions, 7 deletions
diff --git a/tests/errors.rs b/tests/errors.rs
index 159473e..3a626c7 100644
--- a/tests/errors.rs
+++ b/tests/errors.rs
@@ -26,7 +26,7 @@ fn test_error_parse() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- format!("failed to parse datetime for key `error` at line 2 column 9 in {}", path.to_str().unwrap())
+ format!("failed to parse datetime for key `error` at line 2 column 9 in {}", path.display())
);
}
@@ -41,7 +41,7 @@ fn test_error_type() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- format!("invalid type: string \"fals\", expected a boolean for key `boolean_s_parse` in {}", path.to_str().unwrap())
+ format!("invalid type: string \"fals\", expected a boolean for key `boolean_s_parse` in {}", path.display())
);
}
diff --git a/tests/file_hjson.rs b/tests/file_hjson.rs
index 1e99b87..70d7ca0 100644
--- a/tests/file_hjson.rs
+++ b/tests/file_hjson.rs
@@ -75,6 +75,6 @@ fn test_error_parse() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().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.to_str().unwrap())
+ 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())
);
}
diff --git a/tests/file_ini.rs b/tests/file_ini.rs
index 057e496..0b7b6a0 100644
--- a/tests/file_ini.rs
+++ b/tests/file_ini.rs
@@ -63,6 +63,6 @@ fn test_error_parse() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- format!(r#"2:0 Expecting "[Some('='), Some(':')]" but found EOF. in {}"#, path.to_str().unwrap())
+ format!(r#"2:0 Expecting "[Some('='), Some(':')]" but found EOF. in {}"#, path.display())
);
}
diff --git a/tests/file_json.rs b/tests/file_json.rs
index 1262585..09c42bb 100644
--- a/tests/file_json.rs
+++ b/tests/file_json.rs
@@ -75,6 +75,6 @@ fn test_error_parse() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- format!("expected `:` at line 4 column 1 in {}", path_with_extension.to_str().unwrap())
+ format!("expected `:` at line 4 column 1 in {}", path_with_extension.display())
);
}
diff --git a/tests/file_toml.rs b/tests/file_toml.rs
index a2a1caf..4d2015e 100644
--- a/tests/file_toml.rs
+++ b/tests/file_toml.rs
@@ -85,6 +85,6 @@ fn test_error_parse() {
assert!(res.is_err());
assert_eq!(
res.unwrap_err().to_string(),
- format!("failed to parse datetime for key `error` at line 2 column 9 in {}", path_with_extension.to_str().unwrap())
+ format!("failed to parse datetime for key `error` at line 2 column 9 in {}", path_with_extension.display())
);
}
diff --git a/tests/file_yaml.rs b/tests/file_yaml.rs
index efc2908..8f7814e 100644
--- a/tests/file_yaml.rs
+++ b/tests/file_yaml.rs
@@ -76,6 +76,6 @@ fn test_error_parse() {
assert_eq!(
res.unwrap_err().to_string(),
format!("while parsing a block mapping, did not find expected key at \
- line 2 column 1 in {}", path_with_extension.to_str().unwrap())
+ line 2 column 1 in {}", path_with_extension.display())
);
}