From ec8e8e4bb6a4ab1769a84dd2944f033f658b77fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 28 Oct 2024 11:41:56 +0800 Subject: [PATCH] test --- plugins/zltx/internal/zltx_test.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/plugins/zltx/internal/zltx_test.go b/plugins/zltx/internal/zltx_test.go index fa3e805..b4952b5 100644 --- a/plugins/zltx/internal/zltx_test.go +++ b/plugins/zltx/internal/zltx_test.go @@ -71,8 +71,7 @@ func TestQuery(t *testing.T) { fmt.Println("order: not found in the string") return } - trimmedResult := requestString[index+len("order:"):] - fmt.Println(trimmedResult) + fmt.Println(requestString[index+len("order:"):]) t.Run("TestQuery", func(t *testing.T) { got, err := zltx.Query(context.Background(), request) @@ -82,16 +81,12 @@ func TestQuery(t *testing.T) { } result := got.String() fmt.Printf("%+v \n", got) - fmt.Printf("%s \n", got.Result.String()) - - index := strings.Index(result, "result:") + index = strings.Index(result, "result:") if index == -1 { fmt.Println("result: not found in the string") return } - // 截取 result: 后面的部分 - trimmedResult := result[index+len("result:"):] - fmt.Println(trimmedResult) + fmt.Println(result[index+len("result:"):]) assert.Equal(t, int(proto.Status_SUCCESS), int(got.Result.Status)) })