mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 03:42:33 +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:
@ -6,7 +6,7 @@ use nu_test_support::{nu, pipeline};
|
||||
fn table_to_csv_text_and_from_csv_text_back_into_table() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
"open caco3_plastics.csv | to csv | from csv | first 1 | get origin "
|
||||
"open caco3_plastics.csv | to csv | from csv | first | get origin "
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "SPAIN");
|
||||
|
@ -6,7 +6,7 @@ use nu_test_support::{nu, pipeline};
|
||||
fn table_to_tsv_text_and_from_tsv_text_back_into_table() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
"open caco3_plastics.tsv | to tsv | from tsv | first 1 | get origin"
|
||||
"open caco3_plastics.tsv | to tsv | from tsv | first | get origin"
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "SPAIN");
|
||||
@ -16,7 +16,7 @@ fn table_to_tsv_text_and_from_tsv_text_back_into_table() {
|
||||
fn table_to_tsv_text_and_from_tsv_text_back_into_table_using_csv_separator() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r"open caco3_plastics.tsv | to tsv | from csv --separator '\t' | first 1 | get origin"
|
||||
r"open caco3_plastics.tsv | to tsv | from csv --separator '\t' | first | get origin"
|
||||
);
|
||||
|
||||
assert_eq!(actual.out, "SPAIN");
|
||||
|
Reference in New Issue
Block a user