nu-table: Fix padding 0 width issues (#10011)

close #10001

cc: @fdncred @amtoine 

note: make sure you rebase/squash

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2023-08-15 03:07:34 +03:00
committed by GitHub
parent 435348aa61
commit 696b2cda4a
2 changed files with 46 additions and 45 deletions

View File

@ -2596,16 +2596,16 @@ fn table_expand_padding_not_default() {
let actual = nu!("$env.config.table.padding = 5; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table -e");
assert_eq!(
actual.out,
"╭──────────────────────┬──────────────────────────────────────────────╮\
│ # │ ab │ c │\
├──────────────────────┼──────────────────────────────────────────────┤\
│ 0 │ 1 │ 2 │ 3 │\
│ 1 │ 4 │ 5 │ ╭───────────┬───────────╮ │\
│ │ │ 0 │ 1 │ │\
│ │ │ 1 │ 2 │ │\
│ │ │ 2 │ 3 │ │\
│ │ ╰───────────┴───────────╯ │\
╰──────────────────────┴──────────────────────────────────────────────╯"
"╭─────────────┬─────────────┬─────────────┬────────────────────────────────────╮\
# │ a b │ c \
├─────────────┼─────────────┼─────────────┼────────────────────────────────────┤\
0 │ 1 │ 2 │ 3 │\
1 │ 4 │ 5 │ ╭───────────┬───────────╮ \
│ │ 0 │ 1 │ \
│ │ 1 │ 2 │ \
│ │ 2 │ 3 │ \
│ ╰───────────┴───────────╯ \
╰─────────────┴─────────────┴─────────────┴────────────────────────────────────╯"
);
}