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

Function TestByteStringIsDeterministic

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

Source from the content-addressed store, hash-verified

135}
136
137func TestByteStringIsDeterministic(t *testing.T) {
138 testBytes := []byte{toCborHeader(TypeBytes, 3), 0x1A, 0x2B, 0x3C}
139 testBytesAsCborSequence := multiappend(testBytes, testBytes)
140
141 for _, testCase := range [][]byte{testBytes, testBytesAsCborSequence} {
142 if err := Deterministic(testCase); err != nil {
143 t.Error("Deterministically encoded byte string should not return false for deterministicy.")
144 }
145 }
146}
147
148func TestLongTextAndByteStringIsDeterministic(t *testing.T) {
149 longStr := "olipakerrankilpikonnajakissajotkajuoksivatkilpaajakilpikonnavoitti"

Callers

nothing calls this directly

Calls 3

toCborHeaderFunction · 0.85
multiappendFunction · 0.85
DeterministicFunction · 0.85

Tested by

no test coverage detected