From 4ae92ca50c584f139d4bfb6dfc13bb3353904225 Mon Sep 17 00:00:00 2001 From: violapioggia <2604296771@qq.com> Date: Mon, 18 Dec 2023 14:16:33 +0800 Subject: [PATCH] chore: optimize TestIndex --- pkg/app/context_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/app/context_test.go b/pkg/app/context_test.go index 85029c458..b603d12f7 100644 --- a/pkg/app/context_test.go +++ b/pkg/app/context_test.go @@ -1344,9 +1344,12 @@ func TestGetWriter(t *testing.T) { func TestIndex(t *testing.T) { ctx := NewContext(0) ctx.ResetWithoutConn() - ctx.SetIndex(int8(1)) + exc := int8(-1) res := ctx.GetIndex() - exc := int8(1) + assert.DeepEqual(t, exc, res) + ctx.SetIndex(int8(1)) + res = ctx.GetIndex() + exc = int8(1) assert.DeepEqual(t, exc, res) }