(t *testing.T)
| 198 | } |
| 199 | |
| 200 | func TestReadFloat32Bytes(t *testing.T) { |
| 201 | var buf bytes.Buffer |
| 202 | en := NewWriter(&buf) |
| 203 | en.WriteFloat32(3.1) |
| 204 | en.Flush() |
| 205 | |
| 206 | out, left, err := ReadFloat32Bytes(buf.Bytes()) |
| 207 | if err != nil { |
| 208 | t.Fatal(err) |
| 209 | } |
| 210 | if len(left) != 0 { |
| 211 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 212 | } |
| 213 | if out != 3.1 { |
| 214 | t.Errorf("%f in; %f out", 3.1, out) |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | func BenchmarkReadFloat32Bytes(b *testing.B) { |
| 219 | f := float32(3.14159) |
nothing calls this directly
no test coverage detected
searching dependent graphs…