mirror of
https://github.com/safing/portbase
synced 2025-09-16 01:59:51 +00:00
Add new functions to add and get data as a container
This commit is contained in:
parent
a747272674
commit
27c55f5d35
2 changed files with 64 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue