diff --git a/test/server.cpp b/test/server.cpp index 77681f5fd..8d9a2054b 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -322,10 +322,9 @@ TEST_F(ServerTest, 404) EXPECT_EQ(404, zfs1_->GET(url)->status) << "url: " << url; } -TEST_F(ServerTest, RandomOnNonExistentBook) +std::string makeExpected404Response(const std::string& body) { - const auto r = zfs1_->GET("/ROOT/random?content=non-existent-book"); - const char expectedResponse[] = R"EXPECTEDRESPONSE( + const std::string preBody = R"PREBODY(
@@ -356,17 +355,27 @@ TEST_F(ServerTest, RandomOnNonExistentBook) +)PREBODY"; + const std::string postBody = R"POSTBODY( + +)POSTBODY"; + + return removeEOLWhitespaceMarkers(preBody + body + postBody); +} + +TEST_F(ServerTest, RandomOnNonExistentBook) +{ + const auto r = zfs1_->GET("/ROOT/random?content=non-existent-book"); + const std::string expectedResponse = makeExpected404Response(R"(No such book: non-existent-book
-