Helper: look up the "client" command from the global table and invoke Parse.
| 167 | |
| 168 | // Helper: look up the "client" command from the global table and invoke Parse. |
| 169 | static Status ParseClientCommand(const std::vector<std::string> &args) { |
| 170 | auto *cmd_table = redis::CommandTable::Get(); |
| 171 | auto it = cmd_table->find("client"); |
| 172 | if (it == cmd_table->end()) { |
| 173 | return {Status::NotOK, "client command not found in table"}; |
| 174 | } |
| 175 | auto cmd = it->second->factory(); |
| 176 | cmd->SetArgs(args); |
| 177 | return cmd->Parse(args); |
| 178 | } |
| 179 | |
| 180 | TEST_F(ServerClientPauseTest, ParsePauseBasic) { |
| 181 | auto s = ParseClientCommand({"client", "pause", "1000"}); |