forked from extern/nushell
make first
behave same way as last
: always return list when with number argument (#6616)
* make `first` behave same way as `last` * better behaviour * fix tests * add tests
This commit is contained in:
@ -6,7 +6,7 @@ use nu_test_support::pipeline;
|
||||
fn filters_by_unit_size_comparison() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
"ls | where size > 1kib | sort-by size | get name | first 1 | str trim"
|
||||
"ls | where size > 1kib | sort-by size | get name | first | str trim"
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "cargo_sample.toml");
|
||||
@ -103,7 +103,7 @@ fn binary_operator_comparisons() {
|
||||
open sample.db
|
||||
| get ints
|
||||
| where z != 1
|
||||
| first 1
|
||||
| first
|
||||
| get z
|
||||
"#
|
||||
));
|
||||
|
Reference in New Issue
Block a user