Skip to content

Commit

Permalink
add test case for limit = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bright-starry-sky committed Sep 23, 2021
1 parent 4560209 commit 23bf1ab
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/storage/test/IndexScanLimitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ TEST_F(IndexScanLimitTest, LookupTagIndexLimit) {
EXPECT_EQ(0, resp.get_data()->rows.size());
}

// limit == 1
{
req.set_limit(1);
auto* processor = LookupProcessor::instance(storageEnv_.get(), nullptr, nullptr);
auto fut = processor->getFuture();
processor->process(req);
auto resp = std::move(fut).get();
EXPECT_EQ(0, resp.result.failed_parts.size());
EXPECT_EQ(1 * parts.size(), resp.get_data()->rows.size());
}

// limit 5 by each part
{
req.set_limit(5);
Expand Down Expand Up @@ -324,6 +335,17 @@ TEST_F(IndexScanLimitTest, LookupEdgeIndexLimit) {
EXPECT_EQ(0, resp.get_data()->rows.size());
}

// limit == 1
{
req.set_limit(1);
auto* processor = LookupProcessor::instance(storageEnv_.get(), nullptr, nullptr);
auto fut = processor->getFuture();
processor->process(req);
auto resp = std::move(fut).get();
EXPECT_EQ(0, resp.result.failed_parts.size());
EXPECT_EQ(1 * parts.size(), resp.get_data()->rows.size());
}

// limit 5 by each part
{
req.set_limit(5);
Expand Down

0 comments on commit 23bf1ab

Please sign in to comment.