Skip to content

Commit

Permalink
Add QueryAssertions.matches(PlanMatchPattern) method.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhofhansl committed Jul 15, 2021
1 parent 47301fb commit c1cf825
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,21 @@ public QueryAssert matches(MaterializedResult expected)
});
}

public final QueryAssert matches(PlanMatchPattern expectedPlan)
{
transaction(runner.getTransactionManager(), runner.getAccessControl())
.execute(session, session -> {
Plan plan = runner.createPlan(session, query, WarningCollector.NOOP);
assertPlan(
session,
runner.getMetadata(),
noopStatsCalculator(),
plan,
expectedPlan);
});
return this;
}

public QueryAssert containsAll(@Language("SQL") String query)
{
MaterializedResult expected = runner.execute(session, query);
Expand Down

0 comments on commit c1cf825

Please sign in to comment.