github.com/kazu/loncha@v0.6.3/structer/structer_test.go (about) 1 package structer_test 2 3 import ( 4 "testing" 5 6 "github.com/kazu/loncha/structer" 7 ) 8 9 func TestStructInfo(t *testing.T) { 10 src := "../example/structer_def.go" 11 pkgname := "example" 12 sinfos, err := structer.StrcutInfos(src, pkgname) 13 14 if err != nil { 15 t.Errorf("StructInfos() err=%s", err.Error()) 16 } 17 18 if len(sinfos) == 0 { 19 t.Errorf("must len(StructInfos())=%d > 0 ", len(sinfos)) 20 } 21 }