From a09e411936244aa515519134dbbd938ae3cadcd4 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 11 Aug 2017 00:07:18 +0900 Subject: Treat | as proper query when it can't be an OR operator --- src/pattern_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pattern_test.go') diff --git a/src/pattern_test.go b/src/pattern_test.go index 7adc51db..4066eb4d 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -16,7 +16,7 @@ func init() { func TestParseTermsExtended(t *testing.T) { terms := parseTerms(true, CaseSmart, false, - "| aaa 'bbb ^ccc ddd$ !eee !'fff !^ggg !hhh$ | ^iii$ ^xxx | 'yyy | | zzz$ | !ZZZ |") + "aaa 'bbb ^ccc ddd$ !eee !'fff !^ggg !hhh$ | ^iii$ ^xxx | 'yyy | zzz$ | !ZZZ |") if len(terms) != 9 || terms[0][0].typ != termFuzzy || terms[0][0].inv || terms[1][0].typ != termExact || terms[1][0].inv || @@ -177,7 +177,8 @@ func TestCacheKey(t *testing.T) { test(true, "foo | bar baz", "baz", false) test(true, "foo | bar | baz", "", false) test(true, "foo | bar !baz", "", false) - test(true, "| | | foo", "foo", true) + test(true, "| | foo", "", false) + test(true, "| | | foo", "foo", false) } func TestCacheable(t *testing.T) { -- cgit v1.2.3