MCPcopy
hub / github.com/uber-go/fx / TestDeepStack

Function TestDeepStack

internal/fxreflect/stack_test.go:68–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestDeepStack(t *testing.T) {
69 t.Run("nest", func(t *testing.T) {
70 // Introduce a few frames.
71 frames := func() []Frame {
72 return func() []Frame {
73 return CallerStack(0, 0)
74 }()
75 }()
76
77 require.True(t, len(frames) > 3, "expected at least three frames")
78 for i, name := range []string{"func1.TestDeepStack.func1.1.2", "func1.1", "func1"} {
79 f := frames[i]
80 assert.Equal(t, "go.uber.org/fx/internal/fxreflect.TestDeepStack."+name, f.Function)
81 assert.Contains(t, f.File, "internal/fxreflect/stack_test.go")
82 assert.NotZero(t, f.Line)
83 }
84 })
85}
86
87func TestStackCallerName(t *testing.T) {
88 t.Parallel()

Callers

nothing calls this directly

Calls 2

CallerStackFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected