Return errors on unexpected inputs to take and first (#7123)

* Fix `take` behaviour for unexpected input types

* Fix `first` behaviour for unexpected input types

* Fix copy paste mistake
This commit is contained in:
Reilly Wood
2022-11-13 15:15:27 -08:00
committed by GitHub
parent 35f9299fc6
commit 336df6c65e
6 changed files with 177 additions and 168 deletions

View File

@ -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 | inc package.version --major --minor | get package.version"
"open cargo_sample.toml | 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 | inc package.version --minor --major | get package.version"
"open cargo_sample.toml | inc package.version --minor --major | get package.version"
);
assert_eq!(actual.out, "1.0.0");