Skip to content

Commit eb10c22

Browse files
committed
Add unit test for yhirose#609
1 parent 708f860 commit eb10c22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2977,6 +2977,11 @@ class ServerTest : public ::testing::Test {
29772977
res.status = 401;
29782978
res.set_header("WWW-Authenticate", "Basic realm=123456");
29792979
})
2980+
.Delete("/issue609",
2981+
[](const httplib::Request &, httplib::Response &res,
2982+
const httplib::ContentReader &) {
2983+
res.set_content("ok", "text/plain");
2984+
})
29802985
#if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT)
29812986
.Get("/compress",
29822987
[&](const Request & /*req*/, Response &res) {
@@ -4048,6 +4053,13 @@ TEST_F(ServerTest, Issue1772) {
40484053
EXPECT_EQ(StatusCode::Unauthorized_401, res->status);
40494054
}
40504055

4056+
TEST_F(ServerTest, Issue609) {
4057+
auto res = cli_.Delete("/issue609");
4058+
ASSERT_TRUE(res);
4059+
EXPECT_EQ(StatusCode::OK_200, res->status);
4060+
EXPECT_EQ(std::string("ok"), res->body);
4061+
}
4062+
40514063
TEST_F(ServerTest, GetStreamedChunked) {
40524064
auto res = cli_.Get("/streamed-chunked");
40534065
ASSERT_TRUE(res);

0 commit comments

Comments
 (0)