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

Function addComplexDumpTests

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

Source from the content-addressed store, hash-verified

275}
276
277func addComplexDumpTests() {
278 // Standard complex64.
279 v := complex(float32(6), -2)
280 nv := (*complex64)(nil)
281 pv := &v
282 vAddr := fmt.Sprintf("%p", pv)
283 pvAddr := fmt.Sprintf("%p", &pv)
284 vt := "complex64"
285 vs := "(6-2i)"
286 addDumpTest(v, "("+vt+") "+vs+"\n")
287 addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
288 addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
289 addDumpTest(nv, "(*"+vt+")(<nil>)\n")
290
291 // Standard complex128.
292 v2 := complex(float64(-6), 2)
293 nv2 := (*complex128)(nil)
294 pv2 := &v2
295 v2Addr := fmt.Sprintf("%p", pv2)
296 pv2Addr := fmt.Sprintf("%p", &pv2)
297 v2t := "complex128"
298 v2s := "(-6+2i)"
299 addDumpTest(v2, "("+v2t+") "+v2s+"\n")
300 addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
301 addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
302 addDumpTest(nv2, "(*"+v2t+")(<nil>)\n")
303}
304
305func addArrayDumpTests() {
306 // Array containing standard ints.

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…