TestAppendNoRealloc tests that appending works when no reallocation is necessary.
(t *testing.T)
| 177 | |
| 178 | // TestAppendNoRealloc tests that appending works when no reallocation is necessary. |
| 179 | func 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. |
nothing calls this directly
no test coverage detected