Skip to content

Commit

Permalink
few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dormando committed Mar 7, 2024
1 parent 518dd3f commit ab14e23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t/proxyrequest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function mcp_config_routes(p)
return rctx:enqueue_and_wait(r, h)
elseif k == "addexist" then
if r:flag_add("O", "overwrite") then
return "SERVER_ERROR flag overwritten\r\n"
return "SERVER_ERROR flag overwritten"
else
return "HD\r\n"
end
Expand Down
16 changes: 16 additions & 0 deletions t/proxyrequest.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ subtest 'req:add_flag' => sub {
$t->be_send(0, "HD\r\n");
$t->c_recv_be();
$t->clear();

$t->c_send("mg addstr N50\r\n");
$t->be_recv(0, "mg addstr N50 F1234\r\n", "be received addstr request");
$t->be_send(0, "HD\r\n");
$t->c_recv_be();
$t->clear();

$t->c_send("mg addnum N50\r\n");
$t->be_recv(0, "mg addnum N50 F5678\r\n", "be received addnum request");
$t->be_send(0, "HD\r\n");
$t->c_recv_be();
$t->clear();

$t->c_send("mg addexist Oexists\r\n");
$t->c_recv("HD\r\n", "client didn't overwrite flag");
$t->clear();
};

done_testing();

0 comments on commit ab14e23

Please sign in to comment.