Show entire table if number of rows requested for last is greater than table size (#2112)

* Show entire table if number of rows requested for last is greater than table size

* rustfmt

* Add test
This commit is contained in:
Joseph T. Lyons
2020-07-04 21:04:17 -04:00
committed by GitHub
parent 8ea2307815
commit 9e82e5a2fa
2 changed files with 21 additions and 7 deletions

View File

@ -54,3 +54,15 @@ fn gets_last_row_when_no_amount_given() {
assert_eq!(actual.out, "1");
})
}
#[test]
fn requests_more_rows_than_table_has() {
let actual = nu!(
cwd: ".", pipeline(
r#"
date | last 50 | count
"#
));
assert_eq!(actual.out, "1");
}