mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-27 18:53:57 +01:00
Add test for searching for just a colon, for bug fixed in f64e466
This commit is contained in:
parent
7b38f5a5d1
commit
eedc401831
@ -123,6 +123,14 @@ func TestSearch(t *testing.T) {
|
|||||||
if len(results) != 1 {
|
if len(results) != 1 {
|
||||||
t.Fatalf("Search() returned %d results, expected 3, results=%#v", len(results), results)
|
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) {
|
func TestChunks(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user