mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Added a unit test.
This commit is contained in:
parent
d0d744d520
commit
9a663aa94e
1 changed files with 10 additions and 0 deletions
10
test/test.cc
10
test/test.cc
|
@ -1041,6 +1041,16 @@ TEST_F(ServerTest, GetMethod200) {
|
||||||
EXPECT_EQ("Hello World!", res->body);
|
EXPECT_EQ("Hello World!", res->body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ServerTest, GetMethod200withPercentEncoding) {
|
||||||
|
auto res = cli_.Get("/%68%69"); // auto res = cli_.Get("/hi");
|
||||||
|
ASSERT_TRUE(res != nullptr);
|
||||||
|
EXPECT_EQ("HTTP/1.1", res->version);
|
||||||
|
EXPECT_EQ(200, res->status);
|
||||||
|
EXPECT_EQ("text/plain", res->get_header_value("Content-Type"));
|
||||||
|
EXPECT_EQ(1, res->get_header_value_count("Content-Type"));
|
||||||
|
EXPECT_EQ("Hello World!", res->body);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(ServerTest, GetMethod302) {
|
TEST_F(ServerTest, GetMethod302) {
|
||||||
auto res = cli_.Get("/");
|
auto res = cli_.Get("/");
|
||||||
ASSERT_TRUE(res != nullptr);
|
ASSERT_TRUE(res != nullptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue