2023-04-28 11:25:44 +00:00
|
|
|
use nu_test_support::nu;
|
2022-06-23 00:19:06 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn row() {
|
2023-04-28 11:25:44 +00:00
|
|
|
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r | debug");
|
2022-06-23 00:19:06 +00:00
|
|
|
|
|
|
|
assert!(actual.out.contains("foo: 1"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn row_but_last() {
|
2023-04-28 11:25:44 +00:00
|
|
|
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r -l | debug");
|
2022-06-23 00:19:06 +00:00
|
|
|
|
|
|
|
assert!(actual.out.contains("foo: 2"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn row_but_all() {
|
2023-04-28 11:25:44 +00:00
|
|
|
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r -a | debug");
|
2022-06-23 00:19:06 +00:00
|
|
|
|
|
|
|
assert!(actual.out.contains("foo: [1, 2]"));
|
|
|
|
}
|