Add new functions to add and get data as a container

This commit is contained in:
Daniel 2019-09-24 14:46:04 +02:00
parent a747272674
commit 27c55f5d35
2 changed files with 64 additions and 2 deletions

View file

@ -66,7 +66,12 @@ func TestContainerDataHandling(t *testing.T) {
}
c8.clean()
compareMany(t, testData, c1.CompileData(), c2.CompileData(), c3.CompileData(), d4, d5, c6.CompileData(), c7.CompileData(), c8.CompileData())
c9 := c8.gatherAsContainer(len(testData))
c10 := c9.gatherAsContainer(len(testData) - 1)
c10.Append(testData[len(testData)-1:])
compareMany(t, testData, c1.CompileData(), c2.CompileData(), c3.CompileData(), d4, d5, c6.CompileData(), c7.CompileData(), c8.CompileData(), c9.CompileData(), c10.CompileData())
}
func compareMany(t *testing.T, reference []byte, other ...[]byte) {
@ -120,6 +125,11 @@ func TestDataFetching(t *testing.T) {
if err == nil {
t.Error("should fail")
}
_, err = c1.GetAsContainer(1000)
if err == nil {
t.Error("should fail")
}
}
func TestBlocks(t *testing.T) {