Skip to content

Commit 77e4bbc

Browse files
author
me
committed
more unit tests
1 parent 71e17da commit 77e4bbc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/unit_tests/message.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ static const url_parsing_test_data test_data[] = {
6565

6666
TEST_SUITE("[MESSAGE]")
6767
{
68+
TEST_CASE("enums")
69+
{
70+
REQUIRE(http::verb_enum(http::verb_label(http::UNKNOWN_VERB)) == http::UNKNOWN_VERB);
71+
REQUIRE(http::verb_enum(http::verb_label(http::GET)) == http::GET);
72+
REQUIRE(http::verb_enum(http::verb_label(http::HEAD)) == http::HEAD);
73+
REQUIRE(http::verb_enum(http::verb_label(http::POST)) == http::POST);
74+
REQUIRE(http::verb_enum(http::verb_label(http::PUT)) == http::PUT);
75+
REQUIRE(http::verb_enum(http::verb_label(http::DELETE)) == http::DELETE);
76+
REQUIRE(http::verb_enum(http::verb_label(http::CONNECT)) == http::CONNECT);
77+
REQUIRE(http::verb_enum(http::verb_label(http::OPTIONS)) == http::OPTIONS);
78+
REQUIRE(http::verb_enum(http::verb_label(http::TRACE)) == http::TRACE);
79+
REQUIRE(http::verb_enum(http::verb_label(http::PATCH)) == http::PATCH);
80+
81+
for (unsigned int f = http::unknown_field ; f <= http::xref ; ++f)
82+
REQUIRE(http::field_enum(http::field_label((http::field)f)) == f);
83+
}
84+
6885
TEST_CASE("url parsing")
6986
{
7087
for (auto data : test_data)

0 commit comments

Comments
 (0)