You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2023/06/22 17:24:11 UTC

[GitHub] [kvrocks] PragmaTwice commented on a diff in pull request #1489: Add Redis-compatible cursors for `SCAN` commands

PragmaTwice commented on code in PR #1489:
URL: https://github.com/apache/kvrocks/pull/1489#discussion_r1238828281


##########
tests/gocase/unit/scan/scan_test.go:
##########
@@ -52,13 +52,26 @@ func TestScanEmptyKey(t *testing.T) {
 	require.Equal(t, []string{"", "fab", "fiz", "foobar"}, keys)
 }
 
-func TestScan(t *testing.T) {
+func TestScanWithNumberCursor(t *testing.T) {
 	srv := util.StartServer(t, map[string]string{})
 	defer srv.Close()
+	ctx := context.Background()
+	rdb := srv.NewClient()
+	defer func() { require.NoError(t, rdb.Close()) }()
+	ScanTest(t, rdb, ctx)
+}
 
+func TestScanWithStringCursor(t *testing.T) {
+	srv := util.StartServer(t, map[string]string{})
+	defer srv.Close()
 	ctx := context.Background()
 	rdb := srv.NewClient()
 	defer func() { require.NoError(t, rdb.Close()) }()
+	require.NoError(t, rdb.ConfigSet(ctx, "redis-cursor-compatible", "no").Err())
+	ScanTest(t, rdb, ctx)
+}

Review Comment:
   The default value of `redis-cursor-compatible` is `no`. I think the `TestScanWithNumberCursor` does not work as expected.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org