From 631deaf25f822c01e78f0fa8843fe8ce9ed2b298 Mon Sep 17 00:00:00 2001 From: Lev Zakharov Date: Sun, 17 Dec 2023 13:13:01 +0300 Subject: [PATCH] test: fix WriteArg test (#2808) --- internal/proto/writer_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/proto/writer_test.go b/internal/proto/writer_test.go index 55f3d663..7c9d2088 100644 --- a/internal/proto/writer_test.go +++ b/internal/proto/writer_test.go @@ -112,7 +112,7 @@ var _ = Describe("WriteArg", func() { }) args := map[any]string{ - "hello": "$1\r\nhello\r\n", + "hello": "$5\r\nhello\r\n", int(10): "$2\r\n10\r\n", util.ToPtr(int(10)): "$2\r\n10\r\n", int8(10): "$2\r\n10\r\n", @@ -133,8 +133,8 @@ var _ = Describe("WriteArg", func() { util.ToPtr(uint32(10)): "$2\r\n10\r\n", uint64(10): "$2\r\n10\r\n", util.ToPtr(uint64(10)): "$2\r\n10\r\n", - float32(10.3): "$4\r\n10.3\r\n", - util.ToPtr(float32(10.3)): "$4\r\n10.3\r\n", + float32(10.3): "$18\r\n10.300000190734863\r\n", + util.ToPtr(float32(10.3)): "$18\r\n10.300000190734863\r\n", float64(10.3): "$4\r\n10.3\r\n", util.ToPtr(float64(10.3)): "$4\r\n10.3\r\n", bool(true): "$1\r\n1\r\n", @@ -144,6 +144,7 @@ var _ = Describe("WriteArg", func() { } for arg, expect := range args { + arg, expect := arg, expect It(fmt.Sprintf("should write arg of type %T", arg), func() { err := wr.WriteArg(arg) Expect(err).NotTo(HaveOccurred())