MCPcopy Index your code
hub / github.com/expr-lang/expr / addInterfaceDumpTests

Function addInterfaceDumpTests

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

Source from the content-addressed store, hash-verified

522}
523
524func addInterfaceDumpTests() {
525 // Nil interface.
526 var v interface{}
527 nv := (*interface{})(nil)
528 pv := &v
529 vAddr := fmt.Sprintf("%p", pv)
530 pvAddr := fmt.Sprintf("%p", &pv)
531 vt := "interface {}"
532 vs := "<nil>"
533 addDumpTest(v, "("+vt+") "+vs+"\n")
534 addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n")
535 addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n")
536 addDumpTest(nv, "(*"+vt+")(<nil>)\n")
537
538 // Sub-interface.
539 v2 := interface{}(uint16(65535))
540 pv2 := &v2
541 v2Addr := fmt.Sprintf("%p", pv2)
542 pv2Addr := fmt.Sprintf("%p", &pv2)
543 v2t := "uint16"
544 v2s := "65535"
545 addDumpTest(v2, "("+v2t+") "+v2s+"\n")
546 addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n")
547 addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n")
548}
549
550func addMapDumpTests() {
551 // Map with string keys and int vals.

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…