Skip to content

Commit

Permalink
Add test for searching for just a colon, for bug fixed in f64e466
Browse files Browse the repository at this point in the history
  • Loading branch information
ddworken committed Nov 19, 2024
1 parent 7b38f5a commit eedc401
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/lib/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ func TestSearch(t *testing.T) {
if len(results) != 1 {
t.Fatalf("Search() returned %d results, expected 3, results=%#v", len(results), results)
}

// A search for just a plain colon, returns an error but doesn't crash
_, err = Search(ctx, db, ":", 5)
require.Error(t, err)
require.Equal(t, "search query contains malformed search atom ':'", err.Error())
_, err = Search(ctx, db, "foo :", 5)
require.Error(t, err)
require.Equal(t, "search query contains malformed search atom ':'", err.Error())
}

func TestChunks(t *testing.T) {
Expand Down

0 comments on commit eedc401

Please sign in to comment.