1
0
mirror of https://github.com/nushell/nushell.git synced 2025-03-22 19:47:08 +01:00
nushell/crates/nu-command/tests/commands/transpose.rs

23 lines
491 B
Rust
Raw Normal View History

use nu_test_support::nu;
#[test]
fn row() {
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r | debug");
assert!(actual.out.contains("foo: 1"));
}
#[test]
fn row_but_last() {
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r -l | debug");
assert!(actual.out.contains("foo: 2"));
}
#[test]
fn row_but_all() {
let actual = nu!("[[key value]; [foo 1] [foo 2]] | transpose -r -a | debug");
assert!(actual.out.contains("foo: [1, 2]"));
}