github.com/hdt3213/godis@v1.2.9/database/commandinfo_test.go (about) 1 package database 2 3 import ( 4 "github.com/hdt3213/godis/lib/utils" 5 "github.com/hdt3213/godis/redis/connection" 6 "github.com/hdt3213/godis/redis/protocol/asserts" 7 "testing" 8 ) 9 10 func TestCommandInfo(t *testing.T) { 11 c := connection.NewFakeConn() 12 ret := testServer.Exec(c, utils.ToCmdLine("command")) 13 asserts.AssertNotError(t, ret) 14 ret = testServer.Exec(c, utils.ToCmdLine("command", "info", "mset")) 15 asserts.AssertNotError(t, ret) 16 ret = testServer.Exec(c, utils.ToCmdLine("command", "getkeys", "mset", "a", "a", "b", "b")) 17 asserts.AssertMultiBulkReply(t, ret, []string{"a", "b"}) 18 ret = testServer.Exec(c, utils.ToCmdLine("command", "foobar")) 19 asserts.AssertErrReply(t, ret, "Unknown subcommand 'foobar'") 20 }