aboutsummaryrefslogtreecommitdiffstats
path: root/query/parser_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'query/parser_test.go')
-rw-r--r--query/parser_test.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/query/parser_test.go b/query/parser_test.go
index 87dd870a..cef01ffd 100644
--- a/query/parser_test.go
+++ b/query/parser_test.go
@@ -3,7 +3,7 @@ package query
import (
"testing"
- "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
"github.com/MichaelMure/git-bug/bug"
)
@@ -62,6 +62,11 @@ func TestParse(t *testing.T) {
}},
{"sort:unknown", nil},
+ // KVV
+ {`metadata:key:"https://www.example.com/"`, &Query{
+ Filters: Filters{Metadata: []StringPair{{"key", "https://www.example.com/"}}},
+ }},
+
// Search
{"search", &Query{
Search: []string{"search"},
@@ -90,17 +95,17 @@ func TestParse(t *testing.T) {
t.Run(tc.input, func(t *testing.T) {
query, err := Parse(tc.input)
if tc.output == nil {
- assert.Error(t, err)
- assert.Nil(t, query)
+ require.Error(t, err)
+ require.Nil(t, query)
} else {
- assert.NoError(t, err)
+ require.NoError(t, err)
if tc.output.OrderBy != 0 {
- assert.Equal(t, tc.output.OrderBy, query.OrderBy)
+ require.Equal(t, tc.output.OrderBy, query.OrderBy)
}
if tc.output.OrderDirection != 0 {
- assert.Equal(t, tc.output.OrderDirection, query.OrderDirection)
+ require.Equal(t, tc.output.OrderDirection, query.OrderDirection)
}
- assert.Equal(t, tc.output.Filters, query.Filters)
+ require.Equal(t, tc.output.Filters, query.Filters)
}
})
}