From 01a61610da7d58ae40b42cdba51086fc5ffefaea Mon Sep 17 00:00:00 2001 From: Pankaj Date: Thu, 19 Dec 2024 14:42:14 +0530 Subject: [PATCH] Fix: Added test cases to verify the support for zset data type (#1366) --- integration_tests/commands/resp/type_test.go | 8 ++++++++ integration_tests/commands/websocket/type_test.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/integration_tests/commands/resp/type_test.go b/integration_tests/commands/resp/type_test.go index 482fc7b71..8d6c30994 100644 --- a/integration_tests/commands/resp/type_test.go +++ b/integration_tests/commands/resp/type_test.go @@ -72,6 +72,14 @@ func TestType(t *testing.T) { // commands: []string{"SET key1 \"foobar\"", "SET key2 \"abcdef\"", "TYPE dest"}, // expected: []interface{}{"OK", "OK", "string"}, // }, + { + name: "TYPE for key with Zset value", + commands: []string{ + "ZADD myzetset 1 'one' 2 'two'", + "TYPE myzetset", + }, + expected: []interface{}{int64(2), "zset"}, + }, } for _, tc := range testCases { diff --git a/integration_tests/commands/websocket/type_test.go b/integration_tests/commands/websocket/type_test.go index 28ab4303e..a25ca16ab 100644 --- a/integration_tests/commands/websocket/type_test.go +++ b/integration_tests/commands/websocket/type_test.go @@ -67,6 +67,14 @@ func TestType(t *testing.T) { // commands: []string{"SET key1 foobar", "SET key2 abcdef", "TYPE dest"}, // expected: []interface{}{"OK", "OK", "string"}, // }, + { + name: "TYPE for key with Zset value", + commands: []string{ + "ZADD myzetset 1 'one' 2 'two'", + "TYPE myzetset", + }, + expected: []interface{}{float64(2), "zset"}, + }, } for _, tc := range testCases {