You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
615 B

  1. package memory
  2. import (
  3. "github.com/iden3/go-merkletree"
  4. "testing"
  5. "github.com/iden3/go-merkletree/db/test"
  6. "github.com/stretchr/testify/require"
  7. )
  8. func TestMemoryStorageInterface(t *testing.T) {
  9. var db merkletree.Storage //nolint:gosimple
  10. db = NewMemoryStorage()
  11. require.NotNil(t, db)
  12. }
  13. func TestMemory(t *testing.T) {
  14. test.TestReturnKnownErrIfNotExists(t, NewMemoryStorage())
  15. test.TestStorageInsertGet(t, NewMemoryStorage())
  16. test.TestStorageWithPrefix(t, NewMemoryStorage())
  17. test.TestConcatTx(t, NewMemoryStorage())
  18. test.TestList(t, NewMemoryStorage())
  19. test.TestIterate(t, NewMemoryStorage())
  20. }