mirror of
https://github.com/nushell/nushell.git
synced 2024-11-27 02:44:01 +01:00
85d848dd7d
* 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
24 lines
471 B
Rust
24 lines
471 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn drop_rows() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats",
|
|
r#"echo '[{"foo": 3}, {"foo": 8}, {"foo": 4}]' | from json | drop 2 | get foo | math sum | echo $it"#
|
|
);
|
|
|
|
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");
|
|
}
|