mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
22 lines
578 B
Go
22 lines
578 B
Go
package cluster
|
|
|
|
import (
|
|
"github.com/hdt3213/godis/redis/reply/asserts"
|
|
"testing"
|
|
)
|
|
|
|
func TestMSet(t *testing.T) {
|
|
allowFastTransaction = false
|
|
ret := MSet(testCluster, nil, toArgs("MSET", "a", "a", "b", "b"))
|
|
asserts.AssertNotError(t, ret)
|
|
ret = testCluster.Exec(nil, toArgs("MGET", "a", "b"))
|
|
asserts.AssertMultiBulkReply(t, ret, []string{"a", "b"})
|
|
}
|
|
|
|
func TestMSetNx(t *testing.T) {
|
|
allowFastTransaction = false
|
|
FlushAll(testCluster, nil, toArgs("FLUSHALL"))
|
|
ret := MSetNX(testCluster, nil, toArgs("MSETNX", "a", "a", "b", "b"))
|
|
asserts.AssertNotError(t, ret)
|
|
}
|