mirror of
https://github.com/ddworken/hishtory.git
synced 2025-04-16 05:28:32 +02:00
Fix build failure in lib_test
This commit is contained in:
parent
4f708aa58c
commit
1b460adb31
@ -178,7 +178,8 @@ func TestPersist(t *testing.T) {
|
|||||||
func TestSearch(t *testing.T) {
|
func TestSearch(t *testing.T) {
|
||||||
defer testutils.BackupAndRestore(t)()
|
defer testutils.BackupAndRestore(t)()
|
||||||
testutils.Check(t, hctx.InitConfig())
|
testutils.Check(t, hctx.InitConfig())
|
||||||
db := hctx.GetDb(hctx.MakeContext())
|
ctx := hctx.MakeContext()
|
||||||
|
db := hctx.GetDb(ctx)
|
||||||
|
|
||||||
// Insert data
|
// Insert data
|
||||||
entry1 := testutils.MakeFakeHistoryEntry("ls /foo")
|
entry1 := testutils.MakeFakeHistoryEntry("ls /foo")
|
||||||
@ -187,7 +188,7 @@ func TestSearch(t *testing.T) {
|
|||||||
db.Create(entry2)
|
db.Create(entry2)
|
||||||
|
|
||||||
// Search for data
|
// Search for data
|
||||||
results, err := lib.Search(ctx, db, "ls", 5)
|
results, err := Search(ctx, db, "ls", 5)
|
||||||
testutils.Check(t, err)
|
testutils.Check(t, err)
|
||||||
if len(results) != 2 {
|
if len(results) != 2 {
|
||||||
t.Fatalf("Search() returned %d results, expected 2!", len(results))
|
t.Fatalf("Search() returned %d results, expected 2!", len(results))
|
||||||
|
Loading…
Reference in New Issue
Block a user