mirror of
https://github.com/HDT3213/godis.git
synced 2025-09-27 13:12:19 +08:00
21 lines
712 B
Go
21 lines
712 B
Go
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 'foobar'")
|
|
}
|