chroma-markdown/vendor/github.com/alecthomas/chroma/coalesce_test.go

20 lines
368 B
Go
Raw Normal View History

2017-10-22 05:37:38 +02:00
package chroma
import (
"testing"
"github.com/alecthomas/assert"
)
func TestCoalesce(t *testing.T) {
lexer := Coalesce(MustNewLexer(nil, Rules{
"root": []Rule{
{`[!@#$%^&*()]`, Punctuation, nil},
},
}))
actual, err := Tokenise(lexer, nil, "!@#$")
assert.NoError(t, err)
expected := []*Token{{Punctuation, "!@#$"}}
assert.Equal(t, expected, actual)
}