22 lines
530 B
Go
22 lines
530 B
Go
|
package lexers_test
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/alecthomas/assert"
|
||
|
|
||
|
"github.com/alecthomas/chroma/formatters"
|
||
|
"github.com/alecthomas/chroma/lexers"
|
||
|
"github.com/alecthomas/chroma/styles"
|
||
|
)
|
||
|
|
||
|
func TestCompileAllRegexes(t *testing.T) {
|
||
|
for _, lexer := range lexers.Registry.Lexers {
|
||
|
it, err := lexer.Tokenise(nil, "")
|
||
|
assert.NoError(t, err, "%s failed", lexer.Config().Name)
|
||
|
err = formatters.NoOp.Format(ioutil.Discard, styles.SwapOff, it)
|
||
|
assert.NoError(t, err, "%s failed", lexer.Config().Name)
|
||
|
}
|
||
|
}
|