Skip to content

Commit

Permalink
test: cover server/mock/store_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Oct 19, 2022
1 parent 5f1ea92 commit daf3ab5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/mock/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ func TestMultiStore(t *testing.T) {
store := multiStore{}
require.Panics(t, func() { store.Snapshot(1, nil) }, "Snapshot should panic")
require.Panics(t, func() { store.Restore(1, 1, nil) }, "Restore should panic")
require.Panics(t, func() { store.SetIAVLDisableFastNode(false) }, "SetIAVLDisableFastNode should panic")
}
7 changes: 4 additions & 3 deletions store/iavl/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ func TestImmutableTreePanics(t *testing.T) {
it := &immutableTree{immTree}
require.Panics(t, func() { it.Set([]byte{}, []byte{}) })
require.Panics(t, func() { it.Remove([]byte{}) })
require.Panics(t, func() { it.SaveVersion() }) // nolint:errcheck
require.Panics(t, func() { it.DeleteVersion(int64(1)) }) // nolint:errcheck
require.Panics(t, func() { it.LoadVersionForOverwriting(int64(1)) }) // nolint:errcheck
require.Panics(t, func() { it.SaveVersion() }) // nolint:errcheck
require.Panics(t, func() { it.DeleteVersion(int64(1)) }) // nolint:errcheck
require.Panics(t, func() { it.LoadVersionForOverwriting(int64(1)) })
require.Equal(t, it.AvailableVersions(), []int{})

val, err := it.GetVersioned(nil, 1)
require.Error(t, err)
Expand Down

0 comments on commit daf3ab5

Please sign in to comment.