Skip to content

Commit

Permalink
Cleanup cache in index test before performing testing actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMatthes committed Apr 29, 2024
1 parent d733152 commit 81e944d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion histories/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import (
)

func TestHistoryIndex(t *testing.T) {
// Cleanup the history
cache.Range(func(key interface{}, value interface{}) bool {
cache.Delete(key)
return true
})
// Write some dummy histories in the cache.
tempDir := t.TempDir()
exampleCycle := HistoryCycle{
Expand Down Expand Up @@ -83,6 +88,6 @@ func TestHistoryIndex(t *testing.T) {

// Using deep equals here is fine
if !reflect.DeepEqual(unmarshaledIndex, expectedIndex) {
t.Errorf("expected index does not correspond with unmarshaled index")
t.Errorf("expected index does not correspond with unmarshaled index: %v != %v", expectedIndex, unmarshaledIndex)
}
}

0 comments on commit 81e944d

Please sign in to comment.