(t *testing.T, b BufferAt, s string)
| 204 | } |
| 205 | |
| 206 | func Compare(t *testing.T, b BufferAt, s string) { |
| 207 | t.Helper() |
| 208 | data := make([]byte, b.Len()) |
| 209 | n, _ := b.ReadAt(data, 0) |
| 210 | if string(data[:n]) != s { |
| 211 | t.Errorf("Mismatch: got %q want %q", string(data[:n]), s) |
| 212 | } |
| 213 | off := int64(len(s) / 2) |
| 214 | n, _ = b.ReadAt(data, off) |
| 215 | if string(data[:n]) != s[off:] { |
| 216 | t.Errorf("Mismatch: got %q want %q", string(data[:n]), s[off:]) |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | func TestRingComplex(t *testing.T) { |
| 221 | ringSize := 10 |
no test coverage detected
searching dependent graphs…