aboutsummaryrefslogtreecommitdiffstats
path: root/query/lexer_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'query/lexer_test.go')
-rw-r--r--query/lexer_test.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/query/lexer_test.go b/query/lexer_test.go
index 4ffb35a0..6ef679d2 100644
--- a/query/lexer_test.go
+++ b/query/lexer_test.go
@@ -3,7 +3,7 @@ package query
import (
"testing"
- "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func TestTokenize(t *testing.T) {
@@ -37,7 +37,7 @@ func TestTokenize(t *testing.T) {
{`key:'value value`, nil},
{`key:value value'`, nil},
- // sub-qualifier posive testing
+ // sub-qualifier positive testing
{`key:subkey:"value:value"`, []token{newTokenKVV("key", "subkey", "value:value")}},
// sub-qualifier negative testing
@@ -59,13 +59,15 @@ func TestTokenize(t *testing.T) {
}
for _, tc := range tests {
- tokens, err := tokenize(tc.input)
- if tc.tokens == nil {
- assert.Error(t, err)
- assert.Nil(t, tokens)
- } else {
- assert.NoError(t, err)
- assert.Equal(t, tc.tokens, tokens)
- }
+ t.Run(tc.input, func(t *testing.T) {
+ tokens, err := tokenize(tc.input)
+ if tc.tokens == nil {
+ require.Error(t, err)
+ require.Nil(t, tokens)
+ } else {
+ require.NoError(t, err)
+ require.Equal(t, tc.tokens, tokens)
+ }
+ })
}
}