From 3c93fdd0bf1719760c99eec4b243c2be654fa877 Mon Sep 17 00:00:00 2001 From: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:02:02 +0530 Subject: [PATCH] fix: delete lib2 before creating it again --- rueidiscompat/adapter_test.go | 1 + rueidiscompat/command_test.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/rueidiscompat/adapter_test.go b/rueidiscompat/adapter_test.go index 0d0e1905..d11bf281 100644 --- a/rueidiscompat/adapter_test.go +++ b/rueidiscompat/adapter_test.go @@ -8944,6 +8944,7 @@ func testAdapterCache(resp3 bool) { Expect(err).NotTo(HaveOccurred()) Expect(resultAdd).To(BeEquivalentTo("OK")) opt.Replace = false + adapter.TFunctionDelete(ctx, libCodeWithConfig("lib2")).Result() resultAdd, err = adapter.TFunctionLoadArgs(ctx, libCodeWithConfig("lib2"), opt).Result() Expect(err).NotTo(HaveOccurred()) Expect(resultAdd).To(BeEquivalentTo("OK")) diff --git a/rueidiscompat/command_test.go b/rueidiscompat/command_test.go index 5ff4ab12..d1a99eb9 100644 --- a/rueidiscompat/command_test.go +++ b/rueidiscompat/command_test.go @@ -371,6 +371,14 @@ var _ = Describe("Commands", func() { Expect(cursor).To(Equal(uint64(1))) Expect(cmd.Err()).To(BeNil()) } + { + cmd := &ScanCmd{err: errors.New("invalid error")} + cmd.SetVal([]string{"1"}, 1) + keys, cursor := cmd.Val() + Expect(keys).To(Equal([]string{"1"})) + Expect(cursor).To(Equal(uint64(1))) + Expect(cmd.Err().Error()).To(Equal("invalid error")) + } { cmd := &ZSliceCmd{} cmd.SetVal([]Z{{Score: 1}})