table --collapse dont do truncation return message instead (#8172)

Reverts #8042

I've just noticed that #8042 was merged, but I didn't addressed your
@fdncred last comment.
This PR reverts #8042 and returns a message in cases where we need
truncation/wrapping.


157b7e0b60/crates/nu-command/tests/commands/table.rs (L234-L240)

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2023-02-22 21:35:45 +03:00
committed by GitHub
parent c7966e81c2
commit 8deecc0137
3 changed files with 25 additions and 130 deletions

View File

@ -231,6 +231,14 @@ fn table_collapse_hearts() {
);
}
#[test]
fn table_collapse_doesnot_support_width_control() {
let actual = nu!(
r#"[[a]; [11111111111111111111111111111111111111111111111111111111111111111111111111111111]] | table --collapse"#
);
assert_eq!(actual.out, "Couldn't fit table into 80 columns!");
}
#[test]
fn table_expand_0() {
let actual = nu!(r#"[[a b, c]; [1 2 3] [4 5 [1 2 3]]] | table --expand"#);