| 74 | } |
| 75 | |
| 76 | TEST(PlanExecutorTest, Mock) { |
| 77 | auto op = std::make_unique<Mock>(std::vector<ExecutorNode::RowType>{}); |
| 78 | |
| 79 | auto ctx = ExecutorContext(op.get()); |
| 80 | ASSERT_EQ(ctx.Next().GetValue(), exe_end); |
| 81 | |
| 82 | op = std::make_unique<Mock>(std::vector<ExecutorNode::RowType>{{"a"}, {"b"}, {"c"}}); |
| 83 | |
| 84 | ctx = ExecutorContext(op.get()); |
| 85 | ASSERT_EQ(NextRow(ctx).key, "a"); |
| 86 | ASSERT_EQ(NextRow(ctx).key, "b"); |
| 87 | ASSERT_EQ(NextRow(ctx).key, "c"); |
| 88 | ASSERT_EQ(ctx.Next().GetValue(), exe_end); |
| 89 | } |
| 90 | |
| 91 | static auto IndexI() -> const IndexInfo* { return index_map.Find("ia", "search_ns")->second.get(); } |
| 92 | static auto FieldI(const std::string& f) -> const FieldInfo* { return &IndexI()->fields.at(f); } |