From 7d75017e727e1f75ccaa7633dcfb9b138e245fcb Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 12:20:40 +0200 Subject: [PATCH] save game --- src/test.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/test.rs b/src/test.rs index fd00d71..9009c34 100644 --- a/src/test.rs +++ b/src/test.rs @@ -561,6 +561,32 @@ fn color_codes_b5() { assert_eq!(expected, config.format(input)); } +#[test] +fn color_codes_s5() { + let config = AsciiTable::default(); + let input = vec![ + vec![";;;;;".color(Color::Blue).bg_color(Color::Yellow).bold()] + ]; + let expected = "┌───────┐\n\ + │ \u{1b}[38;5;4m\u{1b}[48;5;3;1m;;;;;\u{1b}[0m │\n\ + └───────┘\n"; + + assert_eq!(expected, config.format(input)); +} + +#[test] +fn color_codes_n5() { + let config = AsciiTable::default(); + let input = vec![ + vec!["00000".color(Color::Blue).bg_color(Color::Yellow).bold()] + ]; + let expected = "┌───────┐\n\ + │ \u{1b}[38;5;4m\u{1b}[48;5;3;1m00000\u{1b}[0m │\n\ + └───────┘\n"; + + assert_eq!(expected, config.format(input)); +} + #[test] fn color_codes() { let config = AsciiTable::default();