Stream results of drop command (#2114)

* Stream results of drop command

* When the amount of rows to drop is equal to or greaten than the size of the table, output nothing
This commit is contained in:
Joseph T. Lyons
2020-07-05 13:46:06 -04:00
committed by GitHub
parent 74717582ac
commit 85d848dd7d
2 changed files with 39 additions and 15 deletions

View File

@ -1,4 +1,4 @@
use nu_test_support::nu;
use nu_test_support::{nu, pipeline};
#[test]
fn drop_rows() {
@ -9,3 +9,15 @@ fn drop_rows() {
assert_eq!(actual.out, "3");
}
#[test]
fn drop_more_rows_than_table_has() {
let actual = nu!(
cwd: ".", pipeline(
r#"
date | drop 50 | count
"#
));
assert_eq!(actual.out, "0");
}