From d84a0de94380899a782495995708a58dabf483dc Mon Sep 17 00:00:00 2001 From: Gerrit Viljoen Date: Sun, 17 May 2020 12:32:15 +0200 Subject: [PATCH] save game --- src/lib.rs | 3 ++- src/test.rs | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2570ae5..bc33cd0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -365,7 +365,7 @@ impl SmartString { fragments.push((visible, buf)); visible = !visible; buf = String::new(); - } else if ch != '[' && ch != ';' && !('0'..'9').contains(&ch) { + } else if ch != '[' && ch != ';' && !('0'..='9').contains(&ch) { fragments.push((visible, buf)); visible = !visible; buf = String::new(); @@ -378,6 +378,7 @@ impl SmartString { if !buf.is_empty() { fragments.push((visible, buf)); } + println!("FRAGMENTS: {:?}", fragments); Self { fragments } } diff --git a/src/test.rs b/src/test.rs index cc55102..91728cf 100644 --- a/src/test.rs +++ b/src/test.rs @@ -615,6 +615,26 @@ 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();