From 5a2478c242341d94e2b6ad253d09a738a66cfb99 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Mar 2021 19:49:08 +0100 Subject: [PATCH 1/2] Fix test failure As reported in https://github.com/hjson/hjson-rust/issues/23 the issue of the failing tests is the serde_hjson crate. The problem can be prevented (as reported by https://github.com/hjson/hjson-rust/issues/23#issuecomment-775520018) by disabling the default features of the crate (namingly preservation of key order). This commit disables the default features of serde_hjson to fix our tests. Signed-off-by: Matthias Beyer --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 98a13833..f0f75b6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ nom = "5.0.0" toml = { version = "0.5", optional = true } serde_json = { version = "1.0.2", optional = true } yaml-rust = { version = "0.4", optional = true } -serde-hjson = { version = "0.9", optional = true } +serde-hjson = { version = "0.9", default-features = false, optional = true } rust-ini = { version = "0.13", optional = true } [dev-dependencies] From a9d0ad3b0181130a52a2da60499109e0d65f0549 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 4 Mar 2021 20:17:18 +0100 Subject: [PATCH 2/2] Fix expected error message Signed-off-by: Matthias Beyer --- tests/errors.rs | 2 +- tests/file_toml.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/errors.rs b/tests/errors.rs index e59608e8..47dd050e 100644 --- a/tests/errors.rs +++ b/tests/errors.rs @@ -27,7 +27,7 @@ fn test_error_parse() { assert_eq!( res.unwrap_err().to_string(), format!( - "failed to parse datetime for key `error` at line 2 column 9 in {}", + "invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}", path.display() ) ); diff --git a/tests/file_toml.rs b/tests/file_toml.rs index b9645869..8fbd8a55 100644 --- a/tests/file_toml.rs +++ b/tests/file_toml.rs @@ -86,7 +86,7 @@ fn test_error_parse() { assert_eq!( res.unwrap_err().to_string(), format!( - "failed to parse datetime for key `error` at line 2 column 9 in {}", + "invalid TOML value, did you mean to use a quoted string? at line 2 column 9 in {}", path_with_extension.display() ) );