Skip to content
Myr

Fix unit tests

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 c61eb94 · Browse files · 2 files+7 added−7 removed
This commit

State

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

Diff stats

2 files+7 added−7 removed

  • other:+7 added−7 removed

2 files+7 added−7 removed

modified:src/ansi_test.go+3 added-3 removed
166 unmodified lines
167 strings.Replace(state.ToString(), "\x1b[", "\\x1b[", -1))168 }169 }170 assert("\x1b[m", nil, "")171 assert("\x1b[m", &ansiState{attr: tui.Blink}, "")171 assert("\x1b[m", &ansiState{attr: tui.Blink, lbg: -1}, "")172173 assert("\x1b[31m", nil, "\x1b[31;49m")174 assert("\x1b[41m", nil, "\x1b[39;41m")175176 assert("\x1b[92m", nil, "\x1b[92;49m")177 assert("\x1b[102m", nil, "\x1b[39;102m")178179 assert("\x1b[31m", &ansiState{fg: 4, bg: 4}, "\x1b[31;44m")180 assert("\x1b[1;2;31m", &ansiState{fg: 2, bg: -1, attr: tui.Reverse}, "\x1b[1;2;7;31;49m")179 assert("\x1b[31m", &ansiState{fg: 4, bg: 4, lbg: -1}, "\x1b[31;44m")180 assert("\x1b[1;2;31m", &ansiState{fg: 2, bg: -1, attr: tui.Reverse, lbg: -1}, "\x1b[1;2;7;31;49m")181 assert("\x1b[38;5;100;48;5;200m", nil, "\x1b[38;5;100;48;5;200m")182 assert("\x1b[48;5;100;38;5;200m", nil, "\x1b[38;5;200;48;5;100m")183 assert("\x1b[48;5;100;38;2;10;20;30;1m", nil, "\x1b[1;38;2;10;20;30;48;5;100m")184 assert("\x1b[48;5;100;38;2;10;20;30;7m",
3 unmodified lines
modified:src/result_test.go+4 added-4 removed
107 unmodified lines
108 offsets := []Offset{{5, 15}, {25, 35}}109 item := Result{110 item: &Item{111 colors: &[]ansiOffset{112 {[2]int32{0, 20}, ansiState{1, 5, 0}},113 {[2]int32{22, 27}, ansiState{2, 6, tui.Bold}},114 {[2]int32{30, 32}, ansiState{3, 7, 0}},115 {[2]int32{33, 40}, ansiState{4, 8, tui.Bold}}}}}112 {[2]int32{0, 20}, ansiState{1, 5, 0, -1}},113 {[2]int32{22, 27}, ansiState{2, 6, tui.Bold, -1}},114 {[2]int32{30, 32}, ansiState{3, 7, 0, -1}},115 {[2]int32{33, 40}, ansiState{4, 8, tui.Bold, -1}}}}}116117 colBase := tui.NewColorPair(89, 189, tui.AttrUndefined)118 colMatch := tui.NewColorPair(99, 199, tui.AttrUndefined)119 colors := item.colorOffsets(offsets, tui.Dark256, colBase, colMatch, true)
40 unmodified lines