(data string)
| 6 | ) |
| 7 | |
| 8 | func inputWithSpareCapacity(data string) ([]byte, []byte) { |
| 9 | input := make([]byte, len(data), len(data)+100) |
| 10 | copy(input, data) |
| 11 | |
| 12 | backing := input[:cap(input)] |
| 13 | for i := len(input); i < len(backing); i++ { |
| 14 | backing[i] = 0xa5 |
| 15 | } |
| 16 | |
| 17 | snapshot := append([]byte(nil), backing...) |
| 18 | return input, snapshot |
| 19 | } |
| 20 | |
| 21 | func assertBackingArrayUnchanged(t *testing.T, input, snapshot []byte) { |
| 22 | t.Helper() |
no outgoing calls
no test coverage detected