(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestPacking(t *testing.T) { |
| 37 | const N = 1 << 16 |
| 38 | enc := NewEncoder() |
| 39 | p := Prob(0.1) |
| 40 | for i := 0; i < N; i++ { |
| 41 | if rand.Intn(100) < 10 { |
| 42 | enc.Encode(1, p) |
| 43 | } else { |
| 44 | enc.Encode(0, p) |
| 45 | } |
| 46 | } |
| 47 | enc.Close() |
| 48 | |
| 49 | if len(enc.Bytes()) > N/8 { |
| 50 | t.Fatalf("No packing: %v vs %v", len(enc.Bytes()), N/8) |
| 51 | } |
| 52 | enc.Bytes() |
| 53 | } |
nothing calls this directly
no test coverage detected