mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
6951fb440c
* Remove it-expansion, take 2 * Cleanup * silly update to test CI
38 lines
859 B
Rust
38 lines
859 B
Rust
#[test]
|
|
fn selects_a_row() {
|
|
Playground::setup("nth_test_1", |dirs, sandbox| {
|
|
sandbox.with_files(vec![EmptyFile("notes.txt"), EmptyFile("arepas.txt")]);
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(), pipeline(
|
|
r#"
|
|
ls
|
|
| sort-by name
|
|
| nth 0
|
|
| get name
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "arepas.txt");
|
|
});
|
|
}
|
|
|
|
#[test]
|
|
fn selects_many_rows() {
|
|
Playground::setup("nth_test_2", |dirs, sandbox| {
|
|
sandbox.with_files(vec![EmptyFile("notes.txt"), EmptyFile("arepas.txt")]);
|
|
|
|
let actual = nu!(
|
|
cwd: dirs.test(), pipeline(
|
|
r#"
|
|
ls
|
|
| get name
|
|
| nth 1 0
|
|
| count
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "2");
|
|
});
|
|
}
|