mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 23:08:43 +02:00
Fixes
This commit is contained in:
@ -2867,13 +2867,52 @@ fn table_index_arg() {
|
||||
#[test]
|
||||
fn table_expand_index_arg() {
|
||||
let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic --expand -i false");
|
||||
assert_eq!(actual.out, "+---+-------+| a | b |+---+-------+| 1 | 2 |+---+-------+| 2 | +---+ || | | 4 | || | +---+ || | | 4 | || | +---+ |+---+-------+");
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"+---+-------+\
|
||||
| a | b |\
|
||||
+---+-------+\
|
||||
| 1 | 2 |\
|
||||
+---+-------+\
|
||||
| 2 | +---+ |\
|
||||
| | | 4 | |\
|
||||
| | +---+ |\
|
||||
| | | 4 | |\
|
||||
| | +---+ |\
|
||||
+---+-------+"
|
||||
);
|
||||
|
||||
let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic --expand -i true");
|
||||
assert_eq!(actual.out, "+---+---+-----------+| # | a | b |+---+---+-----------+| 0 | 1 | 2 |+---+---+-----------+| 1 | 2 | +---+---+ || | | | 0 | 4 | || | | +---+---+ || | | | 1 | 4 | || | | +---+---+ |+---+---+-----------+");
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"+---+---+-----------+\
|
||||
| # | a | b |\
|
||||
+---+---+-----------+\
|
||||
| 0 | 1 | 2 |\
|
||||
+---+---+-----------+\
|
||||
| 1 | 2 | +---+---+ |\
|
||||
| | | | 0 | 4 | |\
|
||||
| | | +---+---+ |\
|
||||
| | | | 1 | 4 | |\
|
||||
| | | +---+---+ |\
|
||||
+---+---+-----------+"
|
||||
);
|
||||
|
||||
let actual = nu!("[[a b]; [1 2] [2 [4 4]]] | table --width=80 --theme basic --expand -i 10");
|
||||
assert_eq!(actual.out, "+----+---+-----------+| # | a | b |+----+---+-----------+| 10 | 1 | 2 |+----+---+-----------+| 11 | 2 | +---+---+ || | | | 0 | 4 | || | | +---+---+ || | | | 1 | 4 | || | | +---+---+ |+----+---+-----------+");
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"+----+---+-----------+\
|
||||
| # | a | b |\
|
||||
+----+---+-----------+\
|
||||
| 10 | 1 | 2 |\
|
||||
+----+---+-----------+\
|
||||
| 11 | 2 | +---+---+ |\
|
||||
| | | | 0 | 4 | |\
|
||||
| | | +---+---+ |\
|
||||
| | | | 1 | 4 | |\
|
||||
| | | +---+---+ |\
|
||||
+----+---+-----------+"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user