Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdigital committed Jan 6, 2024
1 parent 9fc7fbb commit 4c54e86
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/database/fts/tsquery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ func TestAppQueryToTsquery(t *testing.T) {
}{
{"empty", "", ""},
{"1 word", "foo", "foo"},
{"2 words", "foo bar", "foo & bar"},
{"2 words", "foo Bar", "foo & bar"},
{"3 words", "foo bar baz", "foo & bar & baz"},
{"operators", "\"make me a\" . (sandwich | panini) !cheese", "make <-> me <-> a <-> (sandwich | panini) & ! cheese"},
{"quotes, operators & parens", "\"make me a \" . (sandwich | panini) !cheese", "make <-> me <-> a <-> (sandwich | panini) & ! cheese"},
{"unmatched quotes", "\"make me a sandwich", "make <-> me <-> a <-> sandwich"},
{"unmatched parens", "\"make me a \" . (sandwich | panini", "make <-> me <-> a <-> (sandwich | panini)"},
{"Ukrainian", "зроби мені бутерброд", "zrobi & meni & buterbrod"},
{"Chinese", "给我做一个三明治", "Gei <-> Wo <-> Zuo <-> Yi <-> Ge <-> San <-> Ming <-> Zhi"},
{"Arabic", "اصنع لي شطيرة", "'Sn`' & ly & 'shTyr@'"},
{"Arabic (quoted)", "\"اصنع لي شطيرة\"", "'Sn`' <-> ly <-> 'shTyr@'"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 4c54e86

Please sign in to comment.