From d7f0279051021d8527faa6bb5fa71d49672caa24 Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 12:33:10 +0200 Subject: [PATCH] save game --- src/test.rs | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/test.rs b/src/test.rs index 91728cf..fd39131 100644 --- a/src/test.rs +++ b/src/test.rs @@ -535,6 +535,19 @@ fn color_codes_zero() { assert_eq!(expected, config.format(input)); } +#[test] +fn color_codes_zero_inbetween() { + let config = AsciiTable::default(); + let input = vec![vec![ + "He\u{1b}[0ml\u{1b}[0mlo" + ]]; + let expected = "┌───────┐\n\ + │ He\u{1b}[0ml\u{1b}[0mlo │\n\ + └───────┘\n"; + + assert_eq!(expected, config.format(input)); +} + #[test] fn color_codes_m5() { let config = AsciiTable::default(); @@ -615,26 +628,6 @@ fn color_codes() { assert_eq!(expected, config.format(input)); } -// \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 - -// (true, ""), -// (false, "\u{1b}[38;2;255;0;0m"), -// (true, "H"), -// (false, "\u{1b}[38;2;255;6;0m"), -// (true, "e"), -// (false, "\u{1b}[38;2;255;13;0m"), -// (true, "l"), -// (false, "\u{1b}[38;2;255;1"), -// (true, "9;0ml"), -// (false, "\u{1b}[38;2;255;26;0m"), -// (true, "o"), -// (false, "\u{1b}[0m") - #[test] fn color_codes_in_header() { let mut config = AsciiTable::default();