Skip to content

Commit 8925499

Browse files
committed
chore: comments
Probably fixes #4213 Signed-off-by: Roman Gershman <[email protected]>
1 parent b3dc680 commit 8925499

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/facade/redis_parser_test.cc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ TEST_F(RedisParserTest, Empty) {
170170
}
171171

172172
TEST_F(RedisParserTest, LargeBulk) {
173-
std::string_view prefix("*1\r\n$1024\r\n");
173+
string_view prefix("*1\r\n$1024\r\n");
174174

175175
ASSERT_EQ(RedisParser::INPUT_PENDING, Parse(prefix));
176176
ASSERT_EQ(prefix.size(), consumed_);
@@ -191,6 +191,18 @@ TEST_F(RedisParserTest, LargeBulk) {
191191
ASSERT_EQ(RedisParser::INPUT_PENDING, Parse(part1));
192192
ASSERT_EQ(RedisParser::INPUT_PENDING, Parse(half));
193193
ASSERT_EQ(RedisParser::OK, Parse("\r\n"));
194+
195+
prefix = "*1\r\n$270000000\r\n";
196+
ASSERT_EQ(RedisParser::INPUT_PENDING, Parse(prefix));
197+
ASSERT_EQ(prefix.size(), consumed_);
198+
string chunk(1000000, 'a');
199+
for (unsigned i = 0; i < 270; ++i) {
200+
ASSERT_EQ(RedisParser::INPUT_PENDING, Parse(chunk));
201+
ASSERT_EQ(chunk.size(), consumed_);
202+
}
203+
ASSERT_EQ(RedisParser::OK, Parse("\r\n"));
204+
ASSERT_THAT(args_, ElementsAre(ArgType(RespExpr::STRING)));
205+
EXPECT_EQ(270000000, args_[0].GetBuf().size());
194206
}
195207

196208
TEST_F(RedisParserTest, NILs) {

0 commit comments

Comments
 (0)