Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Jul 29, 2023
1 parent 41b483d commit 5178d6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions assert/assertions.go
Expand Up @@ -1875,18 +1875,15 @@ func (c *CollectT) FailNow() {
}

// Reset clears the collected errors.
// Deprecated: Not used anymore.
func (c *CollectT) Reset() {
c.errors = nil
panic("Reset() is deprecated")
}

// Copy copies the collected errors to the supplied t.
// Deprecated: Not used anymore.
func (c *CollectT) Copy(t TestingT) {
if tt, ok := t.(tHelper); ok {
tt.Helper()
}
for _, err := range c.errors {
t.Errorf("%v", err)
}
panic("Copy() is deprecated")
}

// EventuallyWithT asserts that given condition will be met in waitFor time,
Expand Down
3 changes: 1 addition & 2 deletions assert/assertions_test.go
Expand Up @@ -2787,15 +2787,14 @@ func TestEventuallyWithTTrue(t *testing.T) {
}

func TestEventuallyWithT_ConcurrencySafe(t *testing.T) {
mockT := new(CollectT)
mockT := new(testing.T)

condition := func(collect *CollectT) {
True(collect, false)
}

// To trigger race conditions, we run EventuallyWithT with a nanosecond tick.
False(t, EventuallyWithT(mockT, condition, 100*time.Millisecond, time.Nanosecond))
Len(t, mockT.errors, 2)
}

func TestNeverFalse(t *testing.T) {
Expand Down

0 comments on commit 5178d6f

Please sign in to comment.