save game

This commit is contained in:
Gerrit Viljoen 2020-05-17 12:17:58 +02:00
parent d3c20f6ff9
commit 41a688ea8b

View File

@ -523,13 +523,28 @@ fn mixed_types() {
} }
#[test] #[test]
fn color_codes() { fn color_codes_zero() {
let config = AsciiTable::default(); let config = AsciiTable::default();
let input = vec![vec![ let input = vec![vec![
"Hello".color(Color::Blue).bg_color(Color::Yellow).bold() "\u{1b}[0mHello\u{1b}[0m"
]]; ]];
let expected = "┌───────┐\n\
\u{1b}[0mHello\u{1b}[0m \n\
\n";
assert_eq!(expected, config.format(input));
}
#[test]
fn color_codes() {
let config = AsciiTable::default();
let input = vec![
vec!["Hello".color(Color::Blue).bg_color(Color::Yellow).bold()],
vec!["Hello".gradient(Color::Red)]
];
let expected = "┌───────┐\n\ let expected = "┌───────┐\n\
\u{1b}[38;5;4m\u{1b}[48;5;3;1mHello\u{1b}[0m \n\ \u{1b}[38;5;4m\u{1b}[48;5;3;1mHello\u{1b}[0m \n\
\u{1b}[38;2;255;0;0mH\u{1b}[38;2;255;6;0me\u{1b}[38;2;255;13;0ml\u{1b}[38;2;255;19;0ml\u{1b}[38;2;255;26;0mo\u{1b}[0m \n\
\n"; \n";
assert_eq!(expected, config.format(input)); assert_eq!(expected, config.format(input));