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