Clean up search code, limit bookmarks list by query and/or tags

This commit is contained in:
2022-06-07 11:07:38 +09:30
parent 1563c7b21d
commit 42fd1973b8
4 changed files with 34 additions and 42 deletions

View File

@@ -47,7 +47,7 @@ func TestAddRemove(t *testing.T) {
t.Errorf("scrape index returned %s", err)
}
searchRes, err := bmm.Search("fox", nil)
searchRes, err := bmm.Search(SearchOptions{Query: "fox"})
if err != nil {
t.Errorf("search returned %s", err)
}
@@ -62,7 +62,7 @@ func TestAddRemove(t *testing.T) {
t.Errorf("scrape index returned %s", err)
}
searchRes, err = bmm.Search("fox", nil)
searchRes, err = bmm.Search(SearchOptions{Query: "fox"})
if err != nil {
t.Errorf("search returned %s", err)
}
@@ -70,7 +70,7 @@ func TestAddRemove(t *testing.T) {
t.Error("got result when should not")
}
searchRes, err = bmm.Search("rabbit", nil)
searchRes, err = bmm.Search(SearchOptions{Query: "rabbit"})
if err != nil {
t.Errorf("search returned %s", err)
}
@@ -83,7 +83,7 @@ func TestAddRemove(t *testing.T) {
t.Errorf("got error when deleting: %s", err)
}
searchRes, err = bmm.Search("rabbit", nil)
searchRes, err = bmm.Search(SearchOptions{Query: "rabbit"})
if err != nil {
t.Errorf("search returned %s", err)
}
@@ -119,7 +119,7 @@ func TestTagIndexing(t *testing.T) {
t.Errorf("scrape index returned %s", err)
}
searchRes, err := bmm.Search("fox", nil)
searchRes, err := bmm.Search(SearchOptions{Query: "fox"})
if err != nil {
t.Errorf("search returned %s", err)
}
@@ -133,7 +133,7 @@ func TestTagIndexing(t *testing.T) {
if err != nil {
t.Errorf("scrape index returned %s", err)
}
searchRes, err = bmm.Search("sloth", nil)
searchRes, err = bmm.Search(SearchOptions{Query: "sloth"})
if err != nil {
t.Errorf("search returned %s", err)
}