(t *testing.T)
| 297 | } |
| 298 | |
| 299 | func TestWriteInt64(t *testing.T) { |
| 300 | var buf bytes.Buffer |
| 301 | wr := NewWriter(&buf) |
| 302 | |
| 303 | for range 10000 { |
| 304 | buf.Reset() |
| 305 | |
| 306 | num := (rand.Int63n(math.MaxInt64)) - (math.MaxInt64 / 2) |
| 307 | |
| 308 | err := wr.WriteInt64(num) |
| 309 | if err != nil { |
| 310 | t.Fatal(err) |
| 311 | } |
| 312 | err = wr.Flush() |
| 313 | if err != nil { |
| 314 | t.Fatal(err) |
| 315 | } |
| 316 | |
| 317 | if buf.Len() > 9 { |
| 318 | t.Errorf("buffer length should be <= 9; it's %d", buf.Len()) |
| 319 | } |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | func BenchmarkWriteInt64(b *testing.B) { |
| 324 | wr := NewWriter(Nowhere) |
nothing calls this directly
no test coverage detected
searching dependent graphs…