MCPcopy Index your code
hub / github.com/tinylib/msgp / TestAppendFloat64

Function TestAppendFloat64

msgp/write_bytes_test.go:206–218  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestAppendFloat64(t *testing.T) {
207 f := float64(3.14159)
208 var buf bytes.Buffer
209 en := NewWriter(&buf)
210
211 var bts []byte
212 en.WriteFloat64(f)
213 en.Flush()
214 bts = AppendFloat64(bts[0:0], f)
215 if !bytes.Equal(buf.Bytes(), bts) {
216 t.Errorf("for float %f, encoder wrote %q; append wrote %q", f, buf.Bytes(), bts)
217 }
218}
219
220func BenchmarkAppendFloat64(b *testing.B) {
221 f := float64(3.14159)

Callers

nothing calls this directly

Calls 5

WriteFloat64Method · 0.95
FlushMethod · 0.95
NewWriterFunction · 0.85
AppendFloat64Function · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…