You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCC/unittest/response_builder_unittest.cc

18 lines
384 B
C++

#include "gtest/gtest.h"
#include "webcc/response_builder.h"
// Empty body should also have `Content-Length` header.
TEST(ResponseBuilderTest, EmptyBody) {
using namespace webcc;
auto response = ResponseBuilder{}.OK()();
bool existed = false;
const auto& value = response->GetHeader(headers::kContentLength, &existed);
EXPECT_TRUE(existed);
EXPECT_EQ("0", value);
}