Skip to content
Myr

Add a test case for the mixed delimiter ANSI sequence (#4169)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 14ef8e8 · Browse files · 1 file+14 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:src/ansi_test.go+14 added
333 unmodified lines
334 }335 assert((*offsets)[0], 0, 6, 2, -1, true)336 assert((*offsets)[1], 6, 11, 200, 100, false)337 })338339 state = nil340 src = "\x1b[1mhello \x1b[22;1;38:2:180:190:254mworld"341 check(func(offsets *[]ansiOffset, state *ansiState) {342 if len(*offsets) != 2 {343 t.Fail()344 }345 var color tui.Color = (1 << 24) + (180 << 16) + (190 << 8) + 254346 if state.fg != color || state.attr != 1 {347 t.Fail()348 }349 assert((*offsets)[0], 0, 6, -1, -1, true)350 assert((*offsets)[1], 6, 11, color, -1, true)351 })352}353354func TestAnsiCodeStringConversion(t *testing.T) {355 assert := func(code string, prevState *ansiState, expected string) {
90 unmodified lines