| 559 | } |
| 560 | |
| 561 | void ExpectBindsTo(Expression expr, std::optional<Expression> expected, |
| 562 | Expression* bound_out = nullptr, |
| 563 | const Schema& schema = *kBoringSchema) { |
| 564 | if (!expected) { |
| 565 | expected = expr; |
| 566 | } |
| 567 | |
| 568 | ASSERT_OK_AND_ASSIGN(auto bound, expr.Bind(schema)); |
| 569 | EXPECT_TRUE(bound.IsBound()); |
| 570 | |
| 571 | ASSERT_OK_AND_ASSIGN(expected, expected->Bind(schema)); |
| 572 | EXPECT_EQ(bound, *expected) << " unbound: " << expr.ToString(); |
| 573 | |
| 574 | if (bound_out) { |
| 575 | *bound_out = bound; |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | TEST(Expression, BindFieldRef) { |
| 580 | // an unbound field_ref does not have the output type set |
no test coverage detected