aboutsummaryrefslogtreecommitdiffstats
path: root/query/lexer_test.go
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-14 16:03:51 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-21 14:15:50 +0100
commitcb61245078a0e8f14e359ed20e0582a695645a08 (patch)
treeaa0e8f4ea3d8a5eb2f7ac3746875b0854c1714bb /query/lexer_test.go
parent956f98b676ab44d19ed522061c9520a32aab1a3c (diff)
downloadgit-bug-cb61245078a0e8f14e359ed20e0582a695645a08.tar.gz
Add ability to search by arbitrary metadata
Example: ~/git/git-bug/git-bug ls --metadata github-url=https://github.com/author/myproject/issues/42 or ~/git/git-bug/git-bug ls metadata:github-url:\"https://github.com/author/myproject/issues/42\" Fixes the cmdline part of <https://github.com/MichaelMure/git-bug/issues/567>.
Diffstat (limited to 'query/lexer_test.go')
-rw-r--r--query/lexer_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/query/lexer_test.go b/query/lexer_test.go
index 59f17dec..4ffb35a0 100644
--- a/query/lexer_test.go
+++ b/query/lexer_test.go
@@ -37,6 +37,14 @@ func TestTokenize(t *testing.T) {
{`key:'value value`, nil},
{`key:value value'`, nil},
+ // sub-qualifier posive testing
+ {`key:subkey:"value:value"`, []token{newTokenKVV("key", "subkey", "value:value")}},
+
+ // sub-qualifier negative testing
+ {`key:subkey:value:value`, nil},
+ {`key:subkey:`, nil},
+ {`key:subkey:"value`, nil},
+
// full text search
{"search", []token{newTokenSearch("search")}},
{"search more terms", []token{