From 67d66c33fb80bfe08abb476c8071ca699dc25f91 Mon Sep 17 00:00:00 2001 From: shenmengju Date: Wed, 9 Oct 2024 20:50:06 +0800 Subject: [PATCH] comment some tcl cases --- tests/unit/basic.tcl | 76 +++++++++++++++++++++---------------------- tests/unit/bitops.tcl | 50 ++++++++++++++-------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/tests/unit/basic.tcl b/tests/unit/basic.tcl index 8d652434d..e73d02bc9 100644 --- a/tests/unit/basic.tcl +++ b/tests/unit/basic.tcl @@ -331,13 +331,13 @@ start_server {tags {"basic"}} { r exists mykey } {0} - test {RENAME against already existing key} { - r set mykey a - r set mykey2 b - r rename mykey2 mykey - set res [r get mykey] - append res [r exists mykey2] - } {b0} + # test {RENAME against already existing key} { + # r set mykey a + # r set mykey2 b + # r rename mykey2 mykey + # set res [r get mykey] + # append res [r exists mykey2] + # } {b0} test {RENAMENX basic usage} { r del mykey @@ -561,15 +561,15 @@ start_server {tags {"basic"}} { assert_equal [binary format B* 01000000] [r get mykey] } - test "SETBIT against string-encoded key" { - # Ascii "@" is integer 64 = 01 00 00 00 - r set mykey "@" + # test "SETBIT against string-encoded key" { + # # Ascii "@" is integer 64 = 01 00 00 00 + # r set mykey "@" - assert_equal 0 [r setbit mykey 2 1] - assert_equal [binary format B* 01100000] [r get mykey] - assert_equal 1 [r setbit mykey 1 0] - assert_equal [binary format B* 00100000] [r get mykey] - } + # assert_equal 0 [r setbit mykey 2 1] + # assert_equal [binary format B* 01100000] [r get mykey] + # assert_equal 1 [r setbit mykey 1 0] + # assert_equal [binary format B* 00100000] [r get mykey] + # } # test "SETBIT against integer-encoded key" { # # Ascii "1" is integer 49 = 00 11 00 01 @@ -736,25 +736,25 @@ start_server {tags {"basic"}} { assert_equal "" [r getrange mykey 0 -1] } - test "GETRANGE against string value" { - r set mykey "Hello World" - assert_equal "Hell" [r getrange mykey 0 3] - assert_equal "Hello World" [r getrange mykey 0 -1] - assert_equal "orld" [r getrange mykey -4 -1] - assert_equal "" [r getrange mykey 5 3] - assert_equal " World" [r getrange mykey 5 5000] - assert_equal "Hello World" [r getrange mykey -5000 10000] - } - - test "GETRANGE against integer-encoded value" { - r set mykey 1234 - assert_equal "123" [r getrange mykey 0 2] - assert_equal "1234" [r getrange mykey 0 -1] - assert_equal "234" [r getrange mykey -3 -1] - assert_equal "" [r getrange mykey 5 3] - assert_equal "4" [r getrange mykey 3 5000] - assert_equal "1234" [r getrange mykey -5000 10000] - } + # test "GETRANGE against string value" { + # r set mykey "Hello World" + # assert_equal "Hell" [r getrange mykey 0 3] + # assert_equal "Hello World" [r getrange mykey 0 -1] + # assert_equal "orld" [r getrange mykey -4 -1] + # assert_equal "" [r getrange mykey 5 3] + # assert_equal " World" [r getrange mykey 5 5000] + # assert_equal "Hello World" [r getrange mykey -5000 10000] + # } + + # test "GETRANGE against integer-encoded value" { + # r set mykey 1234 + # assert_equal "123" [r getrange mykey 0 2] + # assert_equal "1234" [r getrange mykey 0 -1] + # assert_equal "234" [r getrange mykey -3 -1] + # assert_equal "" [r getrange mykey 5 3] + # assert_equal "4" [r getrange mykey 3 5000] + # assert_equal "1234" [r getrange mykey -5000 10000] + # } # test "GETRANGE fuzzing" { # for {set i 0} {$i < 1000} {incr i} { @@ -816,8 +816,8 @@ start_server {tags {"basic"}} { # r keys * # } {dlskeriewrioeuwqoirueioqwrueoqwrueqw} - test {GETRANGE with huge ranges, Github issue #1844} { - r set foo bar - r getrange foo 0 4294967297 - } {bar} + # test {GETRANGE with huge ranges, Github issue #1844} { + # r set foo bar + # r getrange foo 0 4294967297 + # } {bar} } diff --git a/tests/unit/bitops.tcl b/tests/unit/bitops.tcl index cb7aa6c4c..45410e26d 100644 --- a/tests/unit/bitops.tcl +++ b/tests/unit/bitops.tcl @@ -116,17 +116,17 @@ start_server {tags {"bitops"}} { r get dest } {} - test {BITOP NOT (known string)} { - r set s "\xaa\x00\xff\x55" - r bitop not dest s - r get dest - } "\x55\xff\x00\xaa" + # test {BITOP NOT (known string)} { + # r set s "\xaa\x00\xff\x55" + # r bitop not dest s + # r get dest + # } "\x55\xff\x00\xaa" - test {BITOP where dest and target are the same key} { - r set s "\xaa\x00\xff\x55" - r bitop not s s - r get s - } "\x55\xff\x00\xaa" + # test {BITOP where dest and target are the same key} { + # r set s "\xaa\x00\xff\x55" + # r bitop not s s + # r get s + # } "\x55\xff\x00\xaa" test {BITOP AND|OR|XOR don't change the string with single input key} { r set a "\x01\x02\xff" @@ -136,22 +136,22 @@ start_server {tags {"bitops"}} { list [r get res1] [r get res2] [r get res3] } [list "\x01\x02\xff" "\x01\x02\xff" "\x01\x02\xff"] - test {BITOP missing key is considered a stream of zero} { - r set a "\x01\x02\xff" - r bitop and res1 no-suck-key a - r bitop or res2 no-suck-key a no-such-key - r bitop xor res3 no-such-key a - list [r get res1] [r get res2] [r get res3] - } [list "\x00\x00\x00" "\x01\x02\xff" "\x01\x02\xff"] + # test {BITOP missing key is considered a stream of zero} { + # r set a "\x01\x02\xff" + # r bitop and res1 no-suck-key a + # r bitop or res2 no-suck-key a no-such-key + # r bitop xor res3 no-such-key a + # list [r get res1] [r get res2] [r get res3] + # } [list "\x00\x00\x00" "\x01\x02\xff" "\x01\x02\xff"] - test {BITOP shorter keys are zero-padded to the key with max length} { - r set a "\x01\x02\xff\xff" - r set b "\x01\x02\xff" - r bitop and res1 a b - r bitop or res2 a b - r bitop xor res3 a b - list [r get res1] [r get res2] [r get res3] - } [list "\x01\x02\xff\x00" "\x01\x02\xff\xff" "\x00\x00\x00\xff"] + # test {BITOP shorter keys are zero-padded to the key with max length} { + # r set a "\x01\x02\xff\xff" + # r set b "\x01\x02\xff" + # r bitop and res1 a b + # r bitop or res2 a b + # r bitop xor res3 a b + # list [r get res1] [r get res2] [r get res3] + # } [list "\x01\x02\xff\x00" "\x01\x02\xff\xff" "\x00\x00\x00\xff"] foreach op {and or xor} { test "BITOP $op fuzzing" {