mirror of
https://github.com/alecthomas/chroma.git
synced 2025-01-28 03:29:41 +02:00
20 lines
401 B
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)
|
|
}
|