MCPcopy Create free account
hub / github.com/expr-lang/expr / addFloatDumpTests

Function addFloatDumpTests

internal/spew/dump_test.go:249–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

247}
248
249func addFloatDumpTests() {
250 // Standard float32.
251 v := float32(3.1415)
252 nv := (*float32)(nil)
253 pv := &v
254 vAddr := fmt.Sprintf("%p", pv)
255 pvAddr := fmt.Sprintf("%p", &pv)
256 vt := "float32"
257 vs := "3.1415"
258 addDumpTest(v, "("+vt+") "+vs+"\n")
259 addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
260 addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
261 addDumpTest(nv, "(*"+vt+")(<nil>)\n")
262
263 // Standard float64.
264 v2 := float64(3.1415926)
265 nv2 := (*float64)(nil)
266 pv2 := &v2
267 v2Addr := fmt.Sprintf("%p", pv2)
268 pv2Addr := fmt.Sprintf("%p", &pv2)
269 v2t := "float64"
270 v2s := "3.1415926"
271 addDumpTest(v2, "("+v2t+") "+v2s+"\n")
272 addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
273 addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
274 addDumpTest(nv2, "(*"+v2t+")(<nil>)\n")
275}
276
277func addComplexDumpTests() {
278 // Standard complex64.

Callers 1

TestDumpFunction · 0.85

Calls 2

addDumpTestFunction · 0.85
SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…