示例#1
0
func assertOut(t *testing.T, raw interface{}, output []*Doc) {
	if assert.Len(t, raw, len(output)) {
		docs := raw.([]*Doc)

		for i := 0; i < len(docs); i++ {
			assert.Equal(t, output[i].Col, docs[i].Col, "Col")
			assert.Equal(t, output[i].Kind, docs[i].Kind, "Kind")
			assert.Equal(t, output[i].Name, docs[i].Name, "Name")
			assert.Equal(t, output[i].Pkg, docs[i].Pkg, "Pkg")
			assert.Equal(t, output[i].Row, docs[i].Row, "Row")
			assert.Equal(t, output[i].Src, docs[i].Src, "Src")
			assert.Regexp(t, output[i].Fn+"$", docs[i].Fn)
		}
	} else {
		pretty.Logf("Found: %# v", raw)
	}
}
示例#2
0
文件: util.go 项目: zombor/neoism
func logPretty(x interface{}) {
	_, file, line, _ := runtime.Caller(1)
	lineNo := strconv.Itoa(line)
	s := file + ":" + lineNo + ": %# v\n"
	pretty.Logf(s, x)
}