mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
37 lines
683 B
Rust
37 lines
683 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn row() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
[[key value]; [foo 1] [foo 2]] | transpose -r | debug
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains("foo: 1"));
|
|
}
|
|
|
|
#[test]
|
|
fn row_but_last() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
[[key value]; [foo 1] [foo 2]] | transpose -r -l | debug
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains("foo: 2"));
|
|
}
|
|
|
|
#[test]
|
|
fn row_but_all() {
|
|
let actual = nu!(
|
|
cwd: ".", pipeline(
|
|
r#"
|
|
[[key value]; [foo 1] [foo 2]] | transpose -r -a | debug
|
|
"#
|
|
));
|
|
|
|
assert!(actual.out.contains("foo: [1, 2]"));
|
|
}
|