Skip to content

Commit

Permalink
test: cover iavl tree test
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Oct 19, 2022
1 parent 7d11e29 commit 5f1ea92
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions store/iavl/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ 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.SaveVersion() }) // nolint:errcheck
require.Panics(t, func() { it.DeleteVersion(int64(1)) }) // nolint:errcheck
require.Panics(t, func() { it.LoadVersionForOverwriting(int64(1)) }) // nolint:errcheck

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

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

0 comments on commit 5f1ea92

Please sign in to comment.