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:
WindSoilder
2022-12-31 19:35:12 +08:00
committed by GitHub
parent 81a7d17b33
commit e9cc417fd5
29 changed files with 159 additions and 25 deletions

View File

@ -58,7 +58,7 @@ fn requests_more_rows_than_table_has() {
let actual = nu!(
cwd: ".", pipeline(
r#"
date | last 50 | length
[date] | last 50 | length
"#
));
@ -91,3 +91,10 @@ fn last_errors_on_negative_index() {
assert!(actual.err.contains("use a positive value"));
}
#[test]
fn fail_on_non_iterator() {
let actual = nu!(cwd: ".", pipeline("1 | last"));
assert!(actual.err.contains("only_supports_this_input_type"));
}