mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 10:31:30 -06:00
In both FileStore and S3Store, the behavior of calling Ref() twice, or of calling Ref() after Close() was undefined and probably crashy. After this, the semantics are as follows: Once either Ref() or Close() is called, you can't Write() any more. Ref() can be called any number of times Close() can be called any number of times Ref() and Close() can be called in any order. Addresses issue #6
17 lines
351 B
Go
17 lines
351 B
Go
package chunks
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"github.com/attic-labs/noms/ref"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func assertInputInStore(input string, ref ref.Ref, s ChunkStore, assert *assert.Assertions) {
|
|
reader, err := s.Get(ref)
|
|
assert.NoError(err)
|
|
data, err := ioutil.ReadAll(reader)
|
|
assert.NoError(err)
|
|
assert.Equal(input, string(data))
|
|
}
|