(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestBuildTreeSingle(t *testing.T) { |
| 28 | tree := buildTraceTree(errorCaller()) |
| 29 | trace := tree.Trace |
| 30 | |
| 31 | if want, got := 2, len(trace); want != got { |
| 32 | t.Fatalf("trace length mismatch, want %d, got %d", want, got) |
| 33 | } |
| 34 | |
| 35 | if want, got := "braces.dev/errtrace.errorCallee", trace[0].Function; want != got { |
| 36 | t.Errorf("innermost function should be first, want %q, got %q", want, got) |
| 37 | } |
| 38 | |
| 39 | if want, got := "braces.dev/errtrace.errorCaller", trace[1].Function; want != got { |
| 40 | t.Errorf("outermost function should be last, want %q, got %q", want, got) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestBuildTreeMulti(t *testing.T) { |
| 45 | tree := buildTraceTree(errorMultiCaller()) |
nothing calls this directly
no test coverage detected