1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-01-28 03:29:41 +02:00
chroma/coalesce_test.go

20 lines
401 B
Go

package chroma
import (
"testing"
assert "github.com/alecthomas/assert/v2"
)
func TestCoalesce(t *testing.T) {
lexer := Coalesce(mustNewLexer(t, nil, Rules{ // nolint: forbidigo
"root": []Rule{
{`[!@#$%^&*()]`, Punctuation, nil},
},
}))
actual, err := Tokenise(lexer, nil, "!@#$")
assert.NoError(t, err)
expected := []Token{{Punctuation, "!@#$"}}
assert.Equal(t, expected, actual)
}