mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 10:18:34 +02:00
Fix typos and use more idiomatic assertions (#7755)
I have changed `assert!(a == b)` calls to `assert_eq!(a, b)`, which give better error messages. Similarly for `assert!(a != b)` and `assert_ne!(a, b)`. Basically all instances were comparing primitives (string slices or integers), so there is no loss of generality from special-case macros, I have also fixed a number of typos in comments, variable names, and a few user-facing messages.
This commit is contained in:
@ -479,25 +479,25 @@ fn can_list_system_folder() {
|
||||
cwd: "C:\\Windows\\System32", pipeline(
|
||||
r#"ls Configuration* | where name == "Configuration" | get size.0"#
|
||||
));
|
||||
assert!(file_size.out.trim() != "");
|
||||
assert_ne!(file_size.out.trim(), "");
|
||||
|
||||
let file_modified = nu!(
|
||||
cwd: "C:\\Windows\\System32", pipeline(
|
||||
r#"ls Configuration* | where name == "Configuration" | get modified.0"#
|
||||
));
|
||||
assert!(file_modified.out.trim() != "");
|
||||
assert_ne!(file_modified.out.trim(), "");
|
||||
|
||||
let file_accessed = nu!(
|
||||
cwd: "C:\\Windows\\System32", pipeline(
|
||||
r#"ls -l Configuration* | where name == "Configuration" | get accessed.0"#
|
||||
));
|
||||
assert!(file_accessed.out.trim() != "");
|
||||
assert_ne!(file_accessed.out.trim(), "");
|
||||
|
||||
let file_created = nu!(
|
||||
cwd: "C:\\Windows\\System32", pipeline(
|
||||
r#"ls -l Configuration* | where name == "Configuration" | get created.0"#
|
||||
));
|
||||
assert!(file_created.out.trim() != "");
|
||||
assert_ne!(file_created.out.trim(), "");
|
||||
|
||||
let ls_with_filter = nu!(
|
||||
cwd: "C:\\Windows\\System32", pipeline(
|
||||
|
Reference in New Issue
Block a user