Requested changes

This commit is contained in:
simon-curtis
2024-11-08 09:43:50 +00:00
committed by Simon Curtis
parent ced3866916
commit 946da5ea5f
4 changed files with 25 additions and 31 deletions

View File

@ -162,17 +162,15 @@ pub fn check_example_evaluates_to_expected_output(
if let Some(expected) = example.result.as_ref() {
let expected = DebuggableValue(expected);
let result = DebuggableValue(&result);
if result != expected {
assert_eq!(
result,
expected,
"\x1b[31mError:\x1b[0m The result of example \x1b[34m'{}'\x1b[0m for the command \x1b[34m'{}'\x1b[0m differs from the expected value.\n\nExpected: {:?}\nActual: {:?}\n",
example.description,
cmd_name,
expected,
result,
);
}
assert_eq!(
result,
expected,
"Error: The result of example '{}' for the command '{}' differs from the expected value.\n\nExpected: {:?}\nActual: {:?}\n",
example.description,
cmd_name,
expected,
result,
);
}
}