| 78 | } |
| 79 | |
| 80 | void CheckError(const PivotLongerNodeOptions& options, const std::string& message, |
| 81 | StatusCode code = StatusCode::Invalid) { |
| 82 | std::shared_ptr<Table> input = gen::Gen({gen::Step(), gen::Random(boolean())}) |
| 83 | ->FailOnError() |
| 84 | ->Table(/*rows_per_chunk=*/1, /*num_chunks=*/1); |
| 85 | |
| 86 | Declaration plan = Declaration::Sequence({ |
| 87 | {"table_source", TableSourceNodeOptions(std::move(input))}, |
| 88 | {"pivot_longer", options}, |
| 89 | }); |
| 90 | |
| 91 | ASSERT_THAT(DeclarationToStatus(std::move(plan)), |
| 92 | Raises(code, testing::HasSubstr(message))); |
| 93 | } |
| 94 | |
| 95 | TEST(PivotLongerNode, Error) { |
| 96 | PivotLongerNodeOptions options; |
no test coverage detected