mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
refactor command
command
This commit is contained in:
20
database/commandinfo_test.go
Normal file
20
database/commandinfo_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/hdt3213/godis/lib/utils"
|
||||
"github.com/hdt3213/godis/redis/connection"
|
||||
"github.com/hdt3213/godis/redis/protocol/asserts"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCommandInfo(t *testing.T) {
|
||||
c := connection.NewFakeConn()
|
||||
ret := testServer.Exec(c, utils.ToCmdLine("command"))
|
||||
asserts.AssertNotError(t, ret)
|
||||
ret = testServer.Exec(c, utils.ToCmdLine("command", "info", "mset"))
|
||||
asserts.AssertNotError(t, ret)
|
||||
ret = testServer.Exec(c, utils.ToCmdLine("command", "getkeys", "mset", "a", "a", "b", "b"))
|
||||
asserts.AssertMultiBulkReply(t, ret, []string{"a", "b"})
|
||||
ret = testServer.Exec(c, utils.ToCmdLine("command", "foobar"))
|
||||
asserts.AssertErrReply(t, ret, "Unknown subcommand or wrong number of arguments for 'foobar'")
|
||||
}
|
Reference in New Issue
Block a user