mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
last, skip, drop, take until, take while, skip until, skip while, where, reverse, shuffle, append, prepend and sort-by raise error when given non-lists (#7623)
Closes https://github.com/nushell/nushell/issues/6941
This commit is contained in:
@ -51,7 +51,7 @@ fn fails_on_string() {
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("pipeline_mismatch"));
|
||||
assert!(actual.err.contains("only_supports_this_input_type"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -50,3 +50,10 @@ fn condition_is_met() {
|
||||
assert_eq!(actual.out, "8");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_on_non_iterator() {
|
||||
let actual = nu!(cwd: ".", pipeline("1 | take until {|row| $row == 2}"));
|
||||
|
||||
assert!(actual.err.contains("only_supports_this_input_type"));
|
||||
}
|
||||
|
@ -49,3 +49,10 @@ fn condition_is_met() {
|
||||
assert_eq!(actual.out, "4");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fail_on_non_iterator() {
|
||||
let actual = nu!(cwd: ".", pipeline("1 | take while {|row| $row == 2}"));
|
||||
|
||||
assert!(actual.err.contains("only_supports_this_input_type"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user