File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,13 @@ Result<bool> IsBoundVisitor::IsBound(const std::shared_ptr<Expression>& expr) {
8585 return Visit<bool , IsBoundVisitor>(expr, visitor);
8686}
8787
88- Result<bool > IsBoundVisitor::AlwaysTrue () { return true ; }
88+ Result<bool > IsBoundVisitor::AlwaysTrue () {
89+ return InvalidExpression (" IsBoundVisitor does not support AlwaysTrue expression" );
90+ }
8991
90- Result<bool > IsBoundVisitor::AlwaysFalse () { return true ; }
92+ Result<bool > IsBoundVisitor::AlwaysFalse () {
93+ return InvalidExpression (" IsBoundVisitor does not support AlwaysFalse expression" );
94+ }
9195
9296Result<bool > IsBoundVisitor::Not (bool child_result) { return child_result; }
9397
Original file line number Diff line number Diff line change @@ -296,14 +296,14 @@ TEST_F(BinderTest, ErrorNestedUnboundField) {
296296class IsBoundVisitorTest : public ExpressionVisitorTest {};
297297
298298TEST_F (IsBoundVisitorTest, Constants) {
299- // True and False are always considered bound
299+ // True and False should error out
300300 auto true_expr = Expressions::AlwaysTrue ();
301- ICEBERG_UNWRAP_OR_FAIL ( auto is_bound_true, IsBoundVisitor::IsBound (true_expr) );
302- EXPECT_TRUE (is_bound_true );
301+ auto result_true = IsBoundVisitor::IsBound (true_expr);
302+ EXPECT_THAT (result_true, IsError (ErrorKind:: kInvalidExpression ) );
303303
304304 auto false_expr = Expressions::AlwaysFalse ();
305- ICEBERG_UNWRAP_OR_FAIL ( auto is_bound_false, IsBoundVisitor::IsBound (false_expr) );
306- EXPECT_TRUE (is_bound_false );
305+ auto result_false = IsBoundVisitor::IsBound (false_expr);
306+ EXPECT_THAT (result_false, IsError (ErrorKind:: kInvalidExpression ) );
307307}
308308
309309TEST_F (IsBoundVisitorTest, UnboundPredicate) {
You can’t perform that action at this time.
0 commit comments