Skip to content

Commit bac693a

Browse files
findepiwendigo
authored andcommitted
Add matches(Session, query) to QueryAssert
1 parent 4e1915c commit bac693a

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

core/trino-main/src/test/java/io/trino/sql/query/QueryAssertions.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,13 @@ public QueryAssert skipResultsCorrectnessCheckForPushdown()
326326
@CanIgnoreReturnValue
327327
public QueryAssert matches(@Language("SQL") String query)
328328
{
329-
result().matches(query);
329+
return matches(session, query);
330+
}
331+
332+
@CanIgnoreReturnValue
333+
public QueryAssert matches(Session session, @Language("SQL") String query)
334+
{
335+
result().matches(session, query);
330336
return this;
331337
}
332338

@@ -570,8 +576,7 @@ public QueryAssert hasCorrectResultsRegardlessOfPushdown()
570576
Session withoutPushdown = Session.builder(session)
571577
.setSystemProperty("allow_pushdown_into_connectors", "false")
572578
.build();
573-
result().matches(runner.execute(withoutPushdown, query()));
574-
return this;
579+
return matches(withoutPushdown, query());
575580
}
576581

577582
private String query()
@@ -681,6 +686,12 @@ public AbstractIntegerAssert<?> rowCount()
681686

682687
@CanIgnoreReturnValue
683688
public ResultAssert matches(@Language("SQL") String query)
689+
{
690+
return matches(session, query);
691+
}
692+
693+
@CanIgnoreReturnValue
694+
public ResultAssert matches(Session session, @Language("SQL") String query)
684695
{
685696
MaterializedResult expected = runner.execute(session, query);
686697
return matches(expected);

0 commit comments

Comments
 (0)