(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func 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 | |
| 87 | func TestStackCallerName(t *testing.T) { |
| 88 | t.Parallel() |
nothing calls this directly
no test coverage detected