20 lines
394 B
Go
20 lines
394 B
Go
|
package chroma
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"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)
|
||
|
}
|