(t *testing.T)
| 83 | } |
| 84 | |
| 85 | func TestVerifyNone(t *testing.T) { |
| 86 | t.Run("VerifyNone finds leaks", func(t *testing.T) { |
| 87 | ft := &fakeT{} |
| 88 | VerifyNone(ft) |
| 89 | require.Empty(t, ft.errors, "Expect no errors from VerifyNone") |
| 90 | |
| 91 | bg := startBlockedG() |
| 92 | VerifyNone(ft, testOptions()) |
| 93 | require.NotEmpty(t, ft.errors, "Expect errors from VerifyNone on leaked goroutine") |
| 94 | bg.unblock() |
| 95 | }) |
| 96 | |
| 97 | t.Run("cleanup registered callback should be called", func(t *testing.T) { |
| 98 | ft := &fakeT{} |
| 99 | cleanupCalled := false |
| 100 | VerifyNone(ft, Cleanup(func(c int) { |
| 101 | assert.Equal(t, 0, c) |
| 102 | cleanupCalled = true |
| 103 | })) |
| 104 | require.True(t, cleanupCalled, "expect cleanup registered callback to be called") |
| 105 | }) |
| 106 | } |
| 107 | |
| 108 | func TestIgnoreCurrent(t *testing.T) { |
| 109 | t.Run("Should ignore current", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…