mirror of
https://github.com/alecthomas/chroma.git
synced 2025-11-23 22:24:39 +02:00
Upgrade project to Go 1.19 and switch to alecthomas/assert/v2
This commit is contained in:
@@ -3,13 +3,13 @@ package chroma
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
assert "github.com/alecthomas/assert/v2"
|
||||
)
|
||||
|
||||
func TestTokenTypeClassifiers(t *testing.T) {
|
||||
require.True(t, GenericDeleted.InCategory(Generic))
|
||||
require.True(t, LiteralStringBacktick.InSubCategory(String))
|
||||
require.Equal(t, LiteralStringBacktick.String(), "LiteralStringBacktick")
|
||||
assert.True(t, GenericDeleted.InCategory(Generic))
|
||||
assert.True(t, LiteralStringBacktick.InSubCategory(String))
|
||||
assert.Equal(t, LiteralStringBacktick.String(), "LiteralStringBacktick")
|
||||
}
|
||||
|
||||
func TestSimpleLexer(t *testing.T) {
|
||||
@@ -30,7 +30,7 @@ func TestSimpleLexer(t *testing.T) {
|
||||
[section]
|
||||
a = 10
|
||||
`)
|
||||
require.NoError(t, err)
|
||||
assert.NoError(t, err)
|
||||
expected := []Token{
|
||||
{Whitespace, "\n\t"},
|
||||
{Comment, "; this is a comment"},
|
||||
@@ -44,5 +44,5 @@ func TestSimpleLexer(t *testing.T) {
|
||||
{LiteralString, "10"},
|
||||
{Whitespace, "\n"},
|
||||
}
|
||||
require.Equal(t, expected, actual)
|
||||
assert.Equal(t, expected, actual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user