nushell/crates/nu-table/tests/expand.rs
Maxim Zhiburt 7162289d77
Add an option to move header on borders (#9796)
A patch to play with.
Need to make a few tests after all.

The question is what shall be done with `table.mode = none`, as it has
no borders.

```nu
$env.config.table.move_header = true
```


![image](https://github.com/nushell/nushell/assets/20165848/cdcffa6d-989c-4368-a436-fdf7d3400e31)

cc: @fdncred

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2023-08-04 07:03:20 +12:00

29 lines
1.1 KiB
Rust

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