| 136 | } |
| 137 | |
| 138 | void CheckValidTestCases(const std::vector<FunctionTestCase>& valid_cases) { |
| 139 | for (const FunctionTestCase& test_case : valid_cases) { |
| 140 | std::shared_ptr<Table> output_table; |
| 141 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<acero::ExecPlan> plan, |
| 142 | PlanFromTestCase(test_case, &output_table)); |
| 143 | plan->StartProducing(); |
| 144 | ASSERT_FINISHES_OK(plan->finished()); |
| 145 | |
| 146 | // Could also modify the Substrait plan with an emit to drop the leading columns |
| 147 | int result_column = output_table->num_columns() - 1; // last column holds result |
| 148 | ASSERT_OK_AND_ASSIGN(output_table, output_table->SelectColumns({result_column})); |
| 149 | |
| 150 | ASSERT_OK_AND_ASSIGN( |
| 151 | std::shared_ptr<Table> expected_output, |
| 152 | GetOutputTable(test_case.expected_output, test_case.expected_output_type)); |
| 153 | AssertTablesEqual(*expected_output, *output_table, /*same_chunk_layout=*/false); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | void CheckErrorTestCases(const std::vector<FunctionTestCase>& error_cases) { |
| 158 | for (const FunctionTestCase& test_case : error_cases) { |
no test coverage detected