Files
dolt/chunks/memory_store_test.go
Rafael Weinstein 591026bcfa Chunk
2015-09-21 13:24:41 -07:00

33 lines
657 B
Go

package chunks
import (
"bytes"
"testing"
"github.com/attic-labs/noms/Godeps/_workspace/src/github.com/stretchr/testify/suite"
)
func TestMemoryStoreTestSuite(t *testing.T) {
suite.Run(t, &MemoryStoreTestSuite{})
}
type MemoryStoreTestSuite struct {
ChunkStoreTestSuite
}
func (suite *MemoryStoreTestSuite) SetupTest() {
suite.Store = NewMemoryStore()
}
func (suite *MemoryStoreTestSuite) TearDownTest() {
suite.Store.Close()
}
func (suite *MemoryStoreTestSuite) TestBadSerialization() {
bad := []byte{0, 1} // Not enough bytes to read first length
ms := NewMemoryStore()
suite.Panics(func() {
Deserialize(bytes.NewReader(bad), ms)
})
}