mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Bump tabled to 0.17 (#14415)
With this comes a new `unicode-width` as I remember there was some issue with `ratatui`. And a bit of refactorings which are ment to reduce code lines while not breaking anything. Not yet complete, I think I'll try to improve some more places, just wanted to trigger CI 😄 And yessssssssss we have a new `unicode-width` but I sort of doubtful, I mean the original issue with emojie. I think it may require an additional "clean" call. I am just saying I was not testing it with that case of complex emojies. --------- Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
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