mirror of
https://gitlab.com/arnekeller/ascii-table.git
synced 2024-12-04 13:39:06 +00:00
save game
This commit is contained in:
parent
2c4042919f
commit
bb24aa7279
15
src/test.rs
15
src/test.rs
@ -533,3 +533,18 @@ fn color_codes() {
|
||||
|
||||
assert_eq!(expected, config.format(input));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn color_codes_in_header() {
|
||||
let mut config = AsciiTable::default();
|
||||
let text = "Hello".color(Color::Blue).bg_color(Color::Yellow).bold();
|
||||
config.columns.insert(0, Column {header: text, ..Column::default()});
|
||||
let input = vec![&[""]];
|
||||
let expected = "┌───────┐\n\
|
||||
│ \u{1b}[38;5;4m\u{1b}[48;5;3;1mHello\u{1b}[0m │\n\
|
||||
├───────┤\n\
|
||||
│ │\n\
|
||||
└───────┘\n";
|
||||
|
||||
assert_eq!(expected, config.format(input));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user