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:
Maxim Zhiburt
2024-12-28 17:19:48 +03:00
committed by GitHub
parent 5314b31b12
commit 4401924128
24 changed files with 1419 additions and 1382 deletions

View File

@ -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]