diff --git a/crates/nu-cmd-lang/src/example_support.rs b/crates/nu-cmd-lang/src/example_support.rs index 4bdbab952e..62cbcb07de 100644 --- a/crates/nu-cmd-lang/src/example_support.rs +++ b/crates/nu-cmd-lang/src/example_support.rs @@ -163,14 +163,14 @@ pub fn check_example_evaluates_to_expected_output( let expected = DebuggableValue(expected); let result = DebuggableValue(&result); if result != expected { - panic!( - "\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\n\ - Expected: {:?}\n\ - Actual: {:?}\n", + 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 + result, ); } } diff --git a/crates/nu-command/src/bytes/at.rs b/crates/nu-command/src/bytes/at.rs index 6c790ff052..b9eb76ed74 100644 --- a/crates/nu-command/src/bytes/at.rs +++ b/crates/nu-command/src/bytes/at.rs @@ -104,7 +104,7 @@ impl Command for BytesAt { }, Example { description: "Slice out `0x[10 01 13]` from `0x[33 44 55 10 01 13]`", - example: "0x[33 44 55 10 01 13 10] | bytes at 3..6", + example: "0x[33 44 55 10 01 13] | bytes at 3..6", result: Some(Value::test_binary(vec![0x10, 0x01, 0x13, 0x10])), }, Example { diff --git a/tests/repl/tests.rs b/tests/repl/tests.rs index 29af82db36..e3a5e89471 100644 --- a/tests/repl/tests.rs +++ b/tests/repl/tests.rs @@ -25,7 +25,7 @@ pub fn run_test(input: &str, expected: &str) -> TestResult { let mut file = NamedTempFile::new()?; let name = file.path(); - let mut cmd: Command = Command::cargo_bin("nu")?; + let mut cmd = Command::cargo_bin("nu")?; cmd.arg("--no-std-lib"); cmd.arg("--no-config-file"); cmd.arg(name);