mirror of
https://github.com/nushell/nushell.git
synced 2025-04-16 09:18:21 +02:00
cargo fmt
This commit is contained in:
parent
119e62e2b4
commit
2c9b09af0d
@ -1106,7 +1106,8 @@ fn create_empty_placeholder(
|
|||||||
let style_computer = &StyleComputer::from_config(engine_state, stack);
|
let style_computer = &StyleComputer::from_config(engine_state, stack);
|
||||||
configure_table(&mut out, &config, style_computer, TableMode::default());
|
configure_table(&mut out, &config, style_computer, TableMode::default());
|
||||||
|
|
||||||
let ret = out.table
|
let ret = out
|
||||||
|
.table
|
||||||
.draw(termwidth)
|
.draw(termwidth)
|
||||||
.expect("Could not create empty table placeholder");
|
.expect("Could not create empty table placeholder");
|
||||||
maybe_strip_color(ret, use_ansi_coloring)
|
maybe_strip_color(ret, use_ansi_coloring)
|
||||||
|
@ -3122,41 +3122,26 @@ fn table_colors() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn empty_table_colors() {
|
fn empty_table_colors() {
|
||||||
let actual = nu!(concat!(
|
let actual = nu!(concat!("$env.config.use_ansi_coloring = true;", "{}",));
|
||||||
"$env.config.use_ansi_coloring = true;",
|
|
||||||
"{}",
|
|
||||||
));
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
actual.out,
|
actual.out,
|
||||||
"\u{1b}[37m╭──────────────╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[2mempty record\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰──────────────╯\u{1b}[0m"
|
"\u{1b}[37m╭──────────────╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[2mempty record\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰──────────────╯\u{1b}[0m"
|
||||||
);
|
);
|
||||||
|
|
||||||
let actual = nu!(concat!(
|
let actual = nu!(concat!("$env.config.use_ansi_coloring = true;", "[]",));
|
||||||
"$env.config.use_ansi_coloring = true;",
|
|
||||||
"[]",
|
|
||||||
));
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
actual.out,
|
actual.out,
|
||||||
"\u{1b}[37m╭────────────╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[2mempty list\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰────────────╯\u{1b}[0m"
|
"\u{1b}[37m╭────────────╮\u{1b}[0m\u{1b}[37m│\u{1b}[0m \u{1b}[2mempty list\u{1b}[0m \u{1b}[37m│\u{1b}[0m\u{1b}[37m╰────────────╯\u{1b}[0m"
|
||||||
);
|
);
|
||||||
|
|
||||||
let actual = nu!(concat!(
|
let actual = nu!(concat!("$env.config.use_ansi_coloring = false;", "{}",));
|
||||||
"$env.config.use_ansi_coloring = false;",
|
|
||||||
"{}",
|
|
||||||
));
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
actual.out,
|
actual.out,
|
||||||
"╭──────────────╮│ empty record │╰──────────────╯"
|
"╭──────────────╮│ empty record │╰──────────────╯"
|
||||||
);
|
);
|
||||||
|
|
||||||
let actual = nu!(concat!(
|
let actual = nu!(concat!("$env.config.use_ansi_coloring = false;", "[]",));
|
||||||
"$env.config.use_ansi_coloring = false;",
|
assert_eq!(actual.out, "╭────────────╮│ empty list │╰────────────╯");
|
||||||
"[]",
|
|
||||||
));
|
|
||||||
assert_eq!(
|
|
||||||
actual.out,
|
|
||||||
"╭────────────╮│ empty list │╰────────────╯"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user