git-bug/cache/query_test.go
Amine Hilaly 2a5fbc4dc9 Expose actors and participants in snapshot and bug excerpt
Append operations authors to each list on Apply() call

Expose actors and participants in graphql

Add actor/participant query filter and documentation
2019-04-04 00:37:57 +02:00

42 lines
745 B
Go

package cache
import "testing"
func TestQueryParse(t *testing.T) {
var tests = []struct {
input string
ok bool
}{
{"gibberish", false},
{"status:", false},
{"status:open", true},
{"status:closed", true},
{"status:unknown", false},
{"author:rene", true},
{`author:"René Descartes"`, true},
{"actor:bernhard", true},
{"participant:leonhard", true},
{"label:hello", true},
{`label:"Good first issue"`, true},
{"title:titleOne", true},
{`title:"Bug titleTwo"`, true},
{"sort:edit", true},
{"sort:unknown", false},
}
for _, test := range tests {
_, err := ParseQuery(test.input)
if (err == nil) != test.ok {
t.Fatalf("Unexpected parse result, expected: %v, err: %v", test.ok, err)
}
}
}