using TCC for MSetNX in cluster

This commit is contained in:
hdt3213
2022-04-08 20:28:13 +08:00
parent e2a1bbbe7d
commit c97f3aae6e
9 changed files with 150 additions and 32 deletions

View File

@@ -22,6 +22,19 @@ func TestExists(t *testing.T) {
asserts.AssertIntReply(t, result, 0)
}
func TestExistIn(t *testing.T) {
testDB.Flush()
key := utils.RandString(10)
value := utils.RandString(10)
key2 := utils.RandString(10)
testDB.Exec(nil, utils.ToCmdLine("set", key, value))
result := testDB.Exec(nil, utils.ToCmdLine("ExistIn", key, key2))
asserts.AssertMultiBulkReply(t, result, []string{key})
key3 := utils.RandString(10)
result = testDB.Exec(nil, utils.ToCmdLine("ExistIn", key2, key3))
asserts.AssertMultiBulkReplySize(t, result, 0)
}
func TestType(t *testing.T) {
testDB.Flush()
key := utils.RandString(10)