mirror of
https://github.com/nushell/nushell.git
synced 2025-01-05 05:50:14 +01:00
Requested Changes
- Removed explicit type annotation. - Changed panic to assert_eq
This commit is contained in:
parent
82c2ae1cfd
commit
7efbfe020c
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user