MCPcopy
hub / github.com/safing/portmaster / TestDataFetching

Function TestDataFetching

base/container/container_test.go:87–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestDataFetching(t *testing.T) {
88 t.Parallel()
89
90 c1 := New(utils.DuplicateBytes(testData))
91 data := c1.GetMax(1)
92 if string(data[0]) != "T" {
93 t.Errorf("failed to GetMax(1), got %s, expected %s", string(data), "T")
94 }
95
96 _, err := c1.Get(1000)
97 if err == nil {
98 t.Error("should fail")
99 }
100
101 _, err = c1.GetAsContainer(1000)
102 if err == nil {
103 t.Error("should fail")
104 }
105}
106
107func TestBlocks(t *testing.T) {
108 t.Parallel()

Callers

nothing calls this directly

Calls 7

DuplicateBytesFunction · 0.92
GetMaxMethod · 0.80
ErrorfMethod · 0.80
GetAsContainerMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected