Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 10d68cf

Browse files
committed
Added a unit test for yhirose#1946
1 parent 996acc5 commit 10d68cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎test/test.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,6 +3700,16 @@ TEST_F(ServerTest, GetRangeWithMaxLongLength) {
37003700
EXPECT_EQ(0U, res->body.size());
37013701
}
37023702

3703+
TEST_F(ServerTest, GetRangeWithZeroToInfinite) {
3704+
auto res = cli_.Get("/with-range", {{"Range", "bytes=0-"}});
3705+
ASSERT_TRUE(res);
3706+
EXPECT_EQ(StatusCode::PartialContent_206, res->status);
3707+
EXPECT_EQ("7", res->get_header_value("Content-Length"));
3708+
EXPECT_EQ(true, res->has_header("Content-Range"));
3709+
EXPECT_EQ("bytes 0-6/7", res->get_header_value("Content-Range"));
3710+
EXPECT_EQ(std::string("abcdefg"), res->body);
3711+
}
3712+
37033713
TEST_F(ServerTest, GetStreamedWithRangeMultipart) {
37043714
auto res =
37053715
cli_.Get("/streamed-with-range", {{make_range_header({{1, 2}, {4, 5}})}});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /