add debug print func! fix #278

This commit is contained in:
astaxie
2013-12-15 20:32:32 +08:00
parent 8368360aec
commit aea3c68c98
2 changed files with 508 additions and 0 deletions

32
toolbox/debug_test.go Normal file
View File

@@ -0,0 +1,32 @@
package toolbox
import (
"testing"
)
type mytype struct {
next *mytype
prev *mytype
}
func TestPrint(t *testing.T) {
Display("v1", 1, "v2", 2, "v3", 3)
}
func TestPrintPoint(t *testing.T) {
var v1 = new(mytype)
var v2 = new(mytype)
v1.prev = nil
v1.next = v2
v2.prev = v1
v2.next = nil
Display("v1", v1, "v2", v2)
}
func TestPrintString(t *testing.T) {
str := GetDisplayString("v1", 1, "v2", 2)
println(str)
}