MCPcopy Create free account
hub / github.com/WICG/webpackage / TestArrayIsDeterministic

Function TestArrayIsDeterministic

go/internal/cbor/deterministic_test.go:181–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

179}
180
181func TestArrayIsDeterministic(t *testing.T) {
182 arr := multiappend([]byte{toCborHeader(TypeArray, 5)}, uint23, uint24, uint45, uint4294967295, uint18446744073709551615)
183 cborSequenceArray := multiappend(arr, arr)
184
185 for _, testCase := range [][]byte{arr, cborSequenceArray} {
186 if err := Deterministic(testCase); err != nil {
187 t.Error("Deterministically encoded CBOR array should not return false for deterministicy.")
188 }
189 }
190}
191
192func TestEmptyArrayIsDeterministic(t *testing.T) {
193 if err := Deterministic([]byte{toCborHeader(TypeArray, 0)}); err != nil {

Callers

nothing calls this directly

Calls 3

multiappendFunction · 0.85
toCborHeaderFunction · 0.85
DeterministicFunction · 0.85

Tested by

no test coverage detected