nushell/crates/nu-cli/tests/commands/drop.rs
Jonathan Turner 2ac501f88e
Adds drop number of rows command (#1663)
* Fix access to columns with quoted names

* Add a drop number of rows from end of table
2020-04-26 18:34:45 +12:00

12 lines
256 B
Rust

use nu_test_support::nu;
#[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 | sum | echo $it"#
);
assert_eq!(actual, "3");
}