mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 11:45:50 +02:00
feat(table): make missing value symbol configurable (#15647)
Co-authored-by: Bahex <17417311+Bahex@users.noreply.github.com>
This commit is contained in:
@ -3359,3 +3359,36 @@ fn table_expand_big_header() {
|
||||
╰───┴──────────────────────────────────────────────────────────────────────────╯"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn table_missing_value() {
|
||||
let actual = nu!(r###"[{foo: null} {} {}] | table"###);
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"╭───┬─────╮\
|
||||
│ # │ foo │\
|
||||
├───┼─────┤\
|
||||
│ 0 │ │\
|
||||
│ 1 │ ❎ │\
|
||||
│ 2 │ ❎ │\
|
||||
╰───┴─────╯",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn table_missing_value_custom() {
|
||||
let actual = nu!(r###"
|
||||
$env.config.table.missing_value_symbol = "NULL";
|
||||
[{foo: null} {} {}] | table
|
||||
"###);
|
||||
assert_eq!(
|
||||
actual.out,
|
||||
"╭───┬──────╮\
|
||||
│ # │ foo │\
|
||||
├───┼──────┤\
|
||||
│ 0 │ │\
|
||||
│ 1 │ NULL │\
|
||||
│ 2 │ NULL │\
|
||||
╰───┴──────╯",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user