mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-15 19:56:55 +00:00
Add a test case for the mixed delimiter ANSI sequence (#4169)
This commit is contained in:
parent
14ef8e8051
commit
d7b13f3408
@ -335,6 +335,20 @@ func TestExtractColor(t *testing.T) {
|
|||||||
assert((*offsets)[0], 0, 6, 2, -1, true)
|
assert((*offsets)[0], 0, 6, 2, -1, true)
|
||||||
assert((*offsets)[1], 6, 11, 200, 100, false)
|
assert((*offsets)[1], 6, 11, 200, 100, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
state = nil
|
||||||
|
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 {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
assert((*offsets)[0], 0, 6, -1, -1, true)
|
||||||
|
assert((*offsets)[1], 6, 11, color, -1, true)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnsiCodeStringConversion(t *testing.T) {
|
func TestAnsiCodeStringConversion(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user