tiny fixes

This commit is contained in:
finley
2022-08-20 22:28:06 +08:00
parent 23a6f95c18
commit 9da335811f
8 changed files with 60 additions and 11 deletions

View File

@@ -31,6 +31,20 @@ func TestMulti(t *testing.T) {
}
}
func TestSyntaxErr(t *testing.T) {
conn := new(connection.FakeConn)
testServer.Exec(conn, utils.ToCmdLine("FLUSHALL"))
result := testServer.Exec(conn, utils.ToCmdLine("multi"))
asserts.AssertNotError(t, result)
result = testServer.Exec(conn, utils.ToCmdLine("set"))
asserts.AssertErrReply(t, result, "ERR wrong number of arguments for 'set' command")
testServer.Exec(conn, utils.ToCmdLine("get", "a"))
result = testServer.Exec(conn, utils.ToCmdLine("exec"))
asserts.AssertErrReply(t, result, "EXECABORT Transaction discarded because of previous errors.")
result = testServer.Exec(conn, utils.ToCmdLine("get", "a"))
asserts.AssertNotError(t, result)
}
func TestRollback(t *testing.T) {
conn := new(connection.FakeConn)
testServer.Exec(conn, utils.ToCmdLine("FLUSHALL"))