Get a few more tests passing

This commit is contained in:
Reilly Wood 2024-06-15 16:57:25 -07:00
parent 9b8cb4b3a3
commit b6767da195

View File

@ -251,9 +251,7 @@ fn table_expand_0() {
let actual = nu!("[[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 --expand");
assert_eq!(
actual.out,
"╭───┬───┬───┬───────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬─────c─────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -274,9 +272,7 @@ fn table_expand_exceed_overlap_0() {
assert_eq!(
actual.out,
"╭───┬────────────────────────┬───┬───────────╮\
# a b c \
\
"╭─#─┬───────────a────────────┬─b─┬─────c─────╮\
0 xxxxxxxxxxxxxxxxxxxxxx 2 3 \
1 4 5 \
0 1 \
@ -294,9 +290,7 @@ fn table_expand_exceed_overlap_0() {
assert_eq!(
actual.out,
"╭──────┬───────────────────────────────────────────────────┬─────┬─────────────╮\
# a b c \
\
"╭──#───┬─────────────────────────a─────────────────────────┬──b──┬──────c──────╮\
0 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2 3 \
1 4 5 \
0 1 \
@ -313,9 +307,7 @@ fn table_expand_deep_0() {
nu!("[[a b, c]; [1 2 3] [4 5 [1 2 [1 2 3]]]] | table --width=80 --expand --expand-deep=1");
assert_eq!(
actual.out,
"╭───┬───┬───┬────────────────────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬───────────c────────────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -332,9 +324,7 @@ fn table_expand_deep_1() {
nu!("[[a b, c]; [1 2 3] [4 5 [1 2 [1 2 3]]]] | table --width=80 --expand --expand-deep=0");
assert_eq!(
actual.out,
"╭───┬───┬───┬────────────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬───────c────────╮\
0 1 2 3 \
1 4 5 [list 3 items] \
"
@ -347,9 +337,7 @@ fn table_expand_flatten_0() {
nu!("[[a b, c]; [1 2 3] [4 5 [1 2 [1 1 1]]]] | table --width=80 --expand --flatten ");
assert_eq!(
actual.out,
"╭───┬───┬───┬───────────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬───────c───────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -367,9 +355,7 @@ fn table_expand_flatten_1() {
);
assert_eq!(
actual.out,
"╭───┬───┬───┬───────────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬───────c───────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -388,9 +374,7 @@ fn table_expand_flatten_and_deep_1() {
assert_eq!(
actual.out,
"╭───┬───┬───┬────────────────────────────────╮\
# a b c \
\
"╭─#─┬─a─┬─b─┬───────────────c────────────────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -411,9 +395,7 @@ fn table_expand_record_0() {
assert_eq!(
actual.out,
"╭───┬───────────╮\
# c \
\
"╭─#─┬─────c─────╮\
0 \
d 1 \
\
@ -2570,9 +2552,7 @@ fn table_padding_not_default() {
nu!("$env.config.table.padding = 5; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80");
assert_eq!(
actual.out,
"╭───────────┬───────────┬───────────┬────────────────────────╮\
# a b c \
\
"╭─────#─────┬─────a─────┬─────b─────┬───────────c────────────╮\
0 1 2 3 \
1 4 5 [list 3 items] \
"
@ -2586,9 +2566,7 @@ fn table_padding_zero() {
);
assert_eq!(
actual.out,
"╭─┬─┬─┬──────────────╮\
#ab c \
\
"╭#┬a┬b┬──────c───────╮\
012 3\
145[list 3 items]\
"
@ -2602,9 +2580,7 @@ fn table_expand_padding_not_default() {
);
assert_eq!(
actual.out,
"╭─────────────┬─────────────┬─────────────┬────────────────────────────────────╮\
# a b c \
\
"╭──────#──────┬──────a──────┬──────b──────┬─────────────────c──────────────────╮\
0 1 2 3 \
1 4 5 \
0 1 \
@ -2620,9 +2596,7 @@ fn table_expand_padding_zero() {
let actual = nu!("$env.config.table.padding = {left: 0, right: 0}; [[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --width=80 -e");
assert_eq!(
actual.out,
"╭─┬─┬─┬─────╮\
#ab c \
\
"╭#┬a┬b┬──c──╮\
012 3\
145\
01\