Refine the parsing of response status line; add UT for utility.
This commit is contained in:
@@ -5,6 +5,7 @@ set(UT_SRCS
|
||||
request_parser_unittest.cc
|
||||
rest_service_manager_unittest.cc
|
||||
url_unittest.cc
|
||||
utility_unittest.cc
|
||||
)
|
||||
|
||||
set(UT_TARGET_NAME webcc_unittest)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "webcc/utility.h"
|
||||
|
||||
TEST(UtilityTest, SplitKV) {
|
||||
const std::string str = "Connection: Keep-Alive";
|
||||
|
||||
std::string key;
|
||||
std::string value;
|
||||
|
||||
bool ok = webcc::SplitKV(str, ':', &key, &value);
|
||||
|
||||
EXPECT_EQ(true, ok);
|
||||
EXPECT_EQ("Connection", key);
|
||||
EXPECT_EQ("Keep-Alive", value);
|
||||
}
|
||||
Reference in New Issue
Block a user