diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-10 20:31:28 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-10 20:31:51 +0900 |
| commit | d7b13f340846c075bb8abbd9aaf726da51d4724f (patch) | |
| tree | fe8db6b52e1eaf343366c53aadcc05f8eebab0f4 /src/ansi_test.go | |
| parent | 14ef8e80519987962008b2da0c95907993d03865 (diff) | |
| download | fzf-d7b13f340846c075bb8abbd9aaf726da51d4724f.tar.gz | |
Add a test case for the mixed delimiter ANSI sequence (#4169)
Diffstat (limited to 'src/ansi_test.go')
| -rw-r--r-- | src/ansi_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ansi_test.go b/src/ansi_test.go index d70224f5..05d8131e 100644 --- a/src/ansi_test.go +++ b/src/ansi_test.go @@ -335,6 +335,20 @@ func TestExtractColor(t *testing.T) { assert((*offsets)[0], 0, 6, 2, -1, true) 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) { |
