mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 23:17:55 +02:00
Fix flakey test failures by removing cache=shared which is a discouraged mode (https://www.sqlite.org/sharedcache.html). WAL is sufficient for our purposes. Plus fix a bug where the TUI would go into an infinite loop if there were zero results.
This commit is contained in:
@ -190,7 +190,7 @@ func TestPersist(t *testing.T) {
|
||||
db := hctx.GetDb(hctx.MakeContext())
|
||||
|
||||
entry := testutils.MakeFakeHistoryEntry("ls ~/")
|
||||
db.Create(entry)
|
||||
testutils.Check(t, db.Create(entry).Error)
|
||||
var historyEntries []*data.HistoryEntry
|
||||
result := db.Find(&historyEntries)
|
||||
testutils.Check(t, result.Error)
|
||||
@ -211,9 +211,9 @@ func TestSearch(t *testing.T) {
|
||||
|
||||
// Insert data
|
||||
entry1 := testutils.MakeFakeHistoryEntry("ls /foo")
|
||||
db.Create(entry1)
|
||||
testutils.Check(t, db.Create(entry1).Error)
|
||||
entry2 := testutils.MakeFakeHistoryEntry("ls /bar")
|
||||
db.Create(entry2)
|
||||
testutils.Check(t, db.Create(entry2).Error)
|
||||
|
||||
// Search for data
|
||||
results, err := Search(ctx, db, "ls", 5)
|
||||
|
Reference in New Issue
Block a user