nushell/crates/nu-table/tests/expand.rs
Maxim Zhiburt 4401924128
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>
2024-12-28 08:19:48 -06:00

23 lines
1,021 B
Rust

mod common;
use common::{create_row, create_table, TestCase};
use nu_table::TableTheme as theme;
#[test]
fn test_expand() {
let table = create_table(
vec![create_row(4); 3],
TestCase::new(50).theme(theme::rounded()).header().expand(),
);
assert_eq!(
table.unwrap(),
"╭────────────┬───────────┬───────────┬───────────╮\n\
│ 0 │ 1 │ 2 │ 3 │\n\
├────────────┼───────────┼───────────┼───────────┤\n\
│ 0 │ 1 │ 2 │ 3 │\n\
│ 0 │ 1 │ 2 │ 3 │\n\
╰────────────┴───────────┴───────────┴───────────╯"
);
}