mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
throw error if any? or all? expression invokes invalid command (#6110)
* throw error if any? or all? expression invokes invalid command * fix tests for windows
This commit is contained in:
@ -55,3 +55,15 @@ fn checks_all_columns_of_a_table_is_true() {
|
||||
|
||||
assert_eq!(actual.out, "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn checks_if_all_returns_error_with_invalid_command() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
[red orange yellow green blue purple] | all? ($it | st length) > 4
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("can't run executable") || actual.err.contains("type_mismatch"));
|
||||
}
|
||||
|
@ -31,3 +31,15 @@ fn checks_any_column_of_a_table_is_true() {
|
||||
|
||||
assert_eq!(actual.out, "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn checks_if_any_returns_error_with_invalid_command() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
[red orange yellow green blue purple] | any? ($it | st length) > 4
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("can't run executable") || actual.err.contains("type_mismatch"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user