mirror of
https://github.com/alecthomas/chroma.git
synced 2025-07-01 00:35:06 +02:00
Emit error tokens when there's a group mismatch.
Also don't panic/recover, as we no longer use panic to report "real" errors. Fixes #295.
This commit is contained in:
@ -2,7 +2,6 @@ package html
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -50,14 +49,6 @@ func TestSplitTokensIntoLines(t *testing.T) {
|
||||
assert.Equal(t, expected, actual)
|
||||
}
|
||||
|
||||
func TestIteratorPanicRecovery(t *testing.T) {
|
||||
it := func() chroma.Token {
|
||||
panic(errors.New("bad"))
|
||||
}
|
||||
err := New().Format(ioutil.Discard, styles.Fallback, it)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestFormatterStyleToCSS(t *testing.T) {
|
||||
builder := styles.Get("github").Builder()
|
||||
builder.Add(chroma.LineHighlight, "bg:#ffffcc")
|
||||
|
Reference in New Issue
Block a user