MCPcopy Create free account
hub / github.com/chain/txvm / TestAppendNoRealloc

Function TestAppendNoRealloc

crypto/sha3/sha3_test.go:179–190  ·  view source on GitHub ↗

TestAppendNoRealloc tests that appending works when no reallocation is necessary.

(t *testing.T)

Source from the content-addressed store, hash-verified

177
178// TestAppendNoRealloc tests that appending works when no reallocation is necessary.
179func TestAppendNoRealloc(t *testing.T) {
180 testUnalignedAndGeneric(t, func(impl string) {
181 buf := make([]byte, 1, 200)
182 d := New224()
183 d.Write([]byte{0xcc})
184 buf = d.Sum(buf)
185 expected := "00DF70ADC49B2E76EEE3A6931B93FA41841C3AF2CDF5B32A18B5478C39"
186 if got := strings.ToUpper(hex.EncodeToString(buf)); got != expected {
187 t.Errorf("%s: got %s, want %s", impl, got, expected)
188 }
189 })
190}
191
192// TestSqueezing checks that squeezing the full output a single time produces
193// the same output as repeatedly squeezing the instance.

Callers

nothing calls this directly

Calls 4

testUnalignedAndGenericFunction · 0.85
New224Function · 0.85
WriteMethod · 0.45
SumMethod · 0.45

Tested by

no test coverage detected