From 5178d6f5f46ec96328e20f0079a411857c5fca17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Burzy=C5=84ski?= Date: Sat, 29 Jul 2023 10:26:43 +0200 Subject: [PATCH] address review comments --- assert/assertions.go | 11 ++++------- assert/assertions_test.go | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/assert/assertions.go b/assert/assertions.go index e6498cd67..f4ef8bcaa 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -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, diff --git a/assert/assertions_test.go b/assert/assertions_test.go index 118983673..5250f8bbb 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -2787,7 +2787,7 @@ 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) @@ -2795,7 +2795,6 @@ func TestEventuallyWithT_ConcurrencySafe(t *testing.T) { // 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) {