mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 00:29:46 +02:00
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:
@@ -7,7 +7,7 @@ fn chooses_highest_increment_if_given_more_than_one() {
|
||||
let actual = nu_with_plugins!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
plugin: ("nu_plugin_inc"),
|
||||
"open cargo_sample.toml | first 1 | inc package.version --major --minor | get package.version"
|
||||
"open cargo_sample.toml | first | inc package.version --major --minor | get package.version"
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "1.0.0");
|
||||
@@ -16,7 +16,7 @@ fn chooses_highest_increment_if_given_more_than_one() {
|
||||
cwd: "tests/fixtures/formats",
|
||||
plugin: ("nu_plugin_inc"),
|
||||
// Regardless of order of arguments
|
||||
"open cargo_sample.toml | first 1 | inc package.version --minor --major | get package.version"
|
||||
"open cargo_sample.toml | first | inc package.version --minor --major | get package.version"
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "1.0.0");
|
||||
|
Reference in New Issue
Block a user