From 73f6b98a767ae188fe1f3d2a08998aefa06e5fc5 Mon Sep 17 00:00:00 2001 From: Xinyuan Du Date: Mon, 15 Apr 2024 23:13:30 +0800 Subject: [PATCH] replace t.error/fatal with assert/request (util_test.go) Signed-off-by: Xinyuan Du --- util_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util_test.go b/util_test.go index 1761bde6..87ab3617 100644 --- a/util_test.go +++ b/util_test.go @@ -20,6 +20,7 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" pb "go.etcd.io/raft/v3/raftpb" @@ -137,9 +138,7 @@ func TestIsResponseMsg(t *testing.T) { for i, tt := range tests { got := IsResponseMsg(tt.msgt) - if got != tt.isResponse { - t.Errorf("#%d: got %v, want %v", i, got, tt.isResponse) - } + assert.Equal(t, tt.isResponse, got, "#%d", i) } }