mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fixed #134
This commit is contained in:
parent
a86f6dfa76
commit
96cacd24f9
2 changed files with 51 additions and 4 deletions
12
test/test.cc
12
test/test.cc
|
@ -445,6 +445,10 @@ protected:
|
|||
EXPECT_EQ(req.body, "PUT");
|
||||
res.set_content(req.body, "text/plain");
|
||||
})
|
||||
.Patch("/patch", [&](const Request& req, Response& res) {
|
||||
EXPECT_EQ(req.body, "PATCH");
|
||||
res.set_content(req.body, "text/plain");
|
||||
})
|
||||
.Delete("/delete", [&](const Request& /*req*/, Response& res) {
|
||||
res.set_content("DELETE", "text/plain");
|
||||
})
|
||||
|
@ -946,6 +950,14 @@ TEST_F(ServerTest, Put)
|
|||
EXPECT_EQ("PUT", res->body);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, Patch)
|
||||
{
|
||||
auto res = cli_.Patch("/patch", "PATCH", "text/plain");
|
||||
ASSERT_TRUE(res != nullptr);
|
||||
EXPECT_EQ(200, res->status);
|
||||
EXPECT_EQ("PATCH", res->body);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, Delete)
|
||||
{
|
||||
auto res = cli_.Delete("/delete");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue