From 077ebe386810abb8d2d079dbc62c895e78e664c2 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 23 Aug 2022 03:00:33 +0800 Subject: [PATCH] clock: add missing package `require` and replace `assert` [skip ci] --- clock/test_clock_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clock/test_clock_test.go b/clock/test_clock_test.go index ff4f45990..ed3f8b002 100644 --- a/clock/test_clock_test.go +++ b/clock/test_clock_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var ( @@ -15,11 +15,11 @@ var ( func TestNow(t *testing.T) { c := NewTestClock(testTime) now := c.Now() - assert.Equal(t, testTime, now) + require.Equal(t, testTime, now) now = now.Add(time.Hour) c.SetTime(now) - assert.Equal(t, now, c.Now()) + require.Equal(t, now, c.Now()) } func TestTickAfter(t *testing.T) { @@ -44,7 +44,7 @@ func TestTickAfter(t *testing.T) { case <-time.After(time.Millisecond): } - assert.Equal(t, expectTick, tick) + require.Equal(t, expectTick, tick) } tickOrTimeOut(ticker0, true) @@ -83,7 +83,7 @@ func TestTickSignal(t *testing.T) { tick := <-ch // Expect that the interval is correctly passed over the channel. - assert.Equal(t, interval, tick) + require.Equal(t, interval, tick) // Once the ticker is registered, set the time to make it fire. c.SetTime(testTime.Add(time.Second))