From 925ef053f0a299b09f702386164ec5e42d60a30f Mon Sep 17 00:00:00 2001 From: amtoine Date: Wed, 3 Apr 2024 22:49:13 +0200 Subject: [PATCH] fix the tests i somehow swapped the two parts of the errors, woopsies :) --- src/config/mod.rs | 4 ++-- src/config/parsing.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 23520d0..249ef1f 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -643,7 +643,7 @@ mod tests { let result = Config::from_value(value); assert!(result.is_err()); let error = result.err().unwrap(); - assert!(error.msg.contains("not a valid config field")); + assert!(error.labels[0].text.contains("not a valid config field")); let value = Value::test_record(record! { "colors" => Value::test_record(record! { @@ -653,7 +653,7 @@ mod tests { let result = Config::from_value(value); assert!(result.is_err()); let error = result.err().unwrap(); - assert!(error.msg.contains("not a valid config field")); + assert!(error.labels[0].text.contains("not a valid config field")); } #[test] diff --git a/src/config/parsing.rs b/src/config/parsing.rs index 569605f..26792a7 100755 --- a/src/config/parsing.rs +++ b/src/config/parsing.rs @@ -358,8 +358,11 @@ mod tests { assert!(result.is_err()); let err = result.err().unwrap(); assert_eq!(err.labels.len(), 1); - assert_eq!(err.labels[0].text, "invalid config"); - assert_eq!(err.msg, format!("`$.{}` {}", cell_path, expected)); + assert_eq!(err.msg, "invalid config"); + assert_eq!( + err.labels[0].text, + format!("`$.{}` {}", cell_path, expected) + ); } #[test]