Example #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)
	}
}
Example #2
0
func logPretty(x interface{}) {
	_, file, line, _ := runtime.Caller(1)
	lineNo := strconv.Itoa(line)
	s := file + ":" + lineNo + ": %# v\n"
	pretty.Logf(s, x)
}