1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-19 19:00:13 +02:00
chroma/coalesce_test.go
2017-06-07 19:47:59 +10:00

22 lines
392 B
Go

package chroma
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCoalesce(t *testing.T) {
lexer := Coalesce(MustNewLexer(nil, Rules{
"root": []Rule{
Rule{`[[:punct:]]`, Punctuation, nil},
},
}))
actual, err := Tokenise(lexer, nil, "!@#$%")
require.NoError(t, err)
expected := []Token{
Token{Punctuation, "!@#$%"},
}
require.Equal(t, expected, actual)
}