Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/highlight/highlight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ func TestSetStyle_unknownStyle(t *testing.T) {
}

func TestHighlighter_LongQuotedStringUsesStringColor(t *testing.T) {
// pins the regexp2 v2.7.1 regression that repainted a 40k-character Go quoted string as an error
// pins the regexp2 v2.7.1 regression that repainted a long Go quoted string as an error
// 20k stays above the old backtracking cap and below Chroma's fixed 250ms rule timeout
h := New("monokai", true)

render := func(n int) string {
Expand All @@ -224,7 +225,7 @@ func TestHighlighter_LongQuotedStringUsesStringColor(t *testing.T) {
return fmt.Sprintf("\033[38;2;%d;%d;%dm", c.Red(), c.Green(), c.Blue())
}

long := render(40000)
long := render(20000)
assert.Contains(t, long, fg(chroma.LiteralString), "long literal must keep the string color")
assert.NotContains(t, long, fg(chroma.Error), "long literal must not be painted as an error token")
}