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
481ede8a6f
commit
d84a0de943
@ -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 }
|
||||
}
|
||||
|
20
src/test.rs
20
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();
|
||||
|
Loading…
Reference in New Issue
Block a user