mirror of
https://github.com/nushell/nushell
synced 2024-11-17 02:07:58 +00:00
cf53264438
* Table operating commands. * Updated merge test for clarity. * More clarity. * Better like this..
32 lines
786 B
Rust
32 lines
786 B
Rust
use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
|
use nu_test_support::playground::Playground;
|
|
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn rows() {
|
|
Playground::setup("keep_test_1", |dirs, sandbox| {
|
|
sandbox.with_files(vec![FileWithContentToBeTrimmed(
|
|
"caballeros.csv",
|
|
r#"
|
|
name,lucky_code
|
|
Andrés,1
|
|
Jonathan,1
|
|
Jason,2
|
|
Yehuda,1
|
|
"#,
|
|
)]);
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(), pipeline(
|
|
r#"
|
|
open caballeros.csv
|
|
| keep 3
|
|
| get lucky_code
|
|
| sum
|
|
| echo $it
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual, "4");
|
|
})
|
|
}
|