8 func TestCaller(t *testing.T) {
12 _, file, line, ok := runtime.Caller(0)
15 t.Fatal("runtime.Caller(0) failed")
18 if got, want := c.file(), file; got != want {
19 t.Errorf("got file == %v, want file == %v", got, want)
22 if got, want := c.line(), line; got != want {
23 t.Errorf("got line == %v, want line == %v", got, want)
31 func (fh *fholder) labyrinth() CallStack {
35 panic("this line only needed for go 1.0")
38 func TestTrace(t *testing.T) {
50 lines := []int{43, 33, 48}
52 for i, line := range lines {
53 if got, want := cs[i].line(), line; got != want {
54 t.Errorf("got line[%d] == %v, want line[%d] == %v", i, got, i, want)