summaryrefslogtreecommitdiff
path: root/src/ansi_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi_test.go')
-rw-r--r--src/ansi_test.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ansi_test.go b/src/ansi_test.go
index 05d8131e..e3431231 100644
--- a/src/ansi_test.go
+++ b/src/ansi_test.go
@@ -337,17 +337,25 @@ func TestExtractColor(t *testing.T) {
})
state = nil
+ var color24 tui.Color = (1 << 24) + (180 << 16) + (190 << 8) + 254
src = "\x1b[1mhello \x1b[22;1;38:2:180:190:254mworld"
check(func(offsets *[]ansiOffset, state *ansiState) {
if len(*offsets) != 2 {
t.Fail()
}
- var color tui.Color = (1 << 24) + (180 << 16) + (190 << 8) + 254
- if state.fg != color || state.attr != 1 {
+ if state.fg != color24 || state.attr != 1 {
t.Fail()
}
assert((*offsets)[0], 0, 6, -1, -1, true)
- assert((*offsets)[1], 6, 11, color, -1, true)
+ assert((*offsets)[1], 6, 11, color24, -1, true)
+ })
+
+ src = "\x1b]133;A\x1b\\hello \x1b]133;C\x1b\\world"
+ check(func(offsets *[]ansiOffset, state *ansiState) {
+ if len(*offsets) != 1 {
+ t.Fail()
+ }
+ assert((*offsets)[0], 0, 11, color24, -1, true)
})
}