(t *testing.T)
| 168 | } |
| 169 | |
| 170 | func TestReadFloat64Bytes(t *testing.T) { |
| 171 | var buf bytes.Buffer |
| 172 | en := NewWriter(&buf) |
| 173 | en.WriteFloat64(3.14159) |
| 174 | en.Flush() |
| 175 | |
| 176 | out, left, err := ReadFloat64Bytes(buf.Bytes()) |
| 177 | if err != nil { |
| 178 | t.Fatal(err) |
| 179 | } |
| 180 | if len(left) != 0 { |
| 181 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 182 | } |
| 183 | if out != 3.14159 { |
| 184 | t.Errorf("%f in; %f out", 3.14159, out) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | func BenchmarkReadFloat64Bytes(b *testing.B) { |
| 189 | f := float64(3.14159) |
nothing calls this directly
no test coverage detected
searching dependent graphs…