MCPcopy Create free account
hub / github.com/apache/arrow / CheckValidTestCases

Function CheckValidTestCases

cpp/src/arrow/engine/substrait/function_test.cc:138–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void 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
157void CheckErrorTestCases(const std::vector<FunctionTestCase>& error_cases) {
158 for (const FunctionTestCase& test_case : error_cases) {

Callers 1

TESTFunction · 0.85

Calls 8

PlanFromTestCaseFunction · 0.85
GetOutputTableFunction · 0.85
AssertTablesEqualFunction · 0.85
finishedMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
StartProducingMethod · 0.45
num_columnsMethod · 0.45
SelectColumnsMethod · 0.45

Tested by

no test coverage detected