MCPcopy Index your code
hub / github.com/bracesdev/errtrace / TestBuildTreeSingle

Function TestBuildTreeSingle

tree_test.go:27–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func 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
44func TestBuildTreeMulti(t *testing.T) {
45 tree := buildTraceTree(errorMultiCaller())

Callers

nothing calls this directly

Calls 2

buildTraceTreeFunction · 0.85
errorCallerFunction · 0.85

Tested by

no test coverage detected