Skip to content

Commit 29862d8

Browse files
committed
Keep DO round-trip assertions independent of fixture license comments
1 parent 2944039 commit 29862d8

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/test/java/net/sf/jsqlparser/statement/DoStatementTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void preservesProceduralBodyAndFollowingStatementsIssue1946() throws Exception {
7979
statement.accept(new StatementDeParser(output), null);
8080
output.append(";\n");
8181
}
82-
assertEquals("SELECT 0;\n" + sql + "\nSELECT 1;\n", output.toString());
82+
assertEquals("SELECT 0;\nDO " + body + ";\nSELECT 1;\n", output.toString());
8383
Statements reparsed = CCJSqlParserUtil.parseStatements(output.toString(),
8484
p -> p.withDialect(Dialect.POSTGRESQL).withUnsupportedStatements(false));
8585
assertEquals(3, reparsed.size());

src/test/resources/postgresql/do-issue1946.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
-- #%L
3+
-- JSQLParser library
4+
-- %%
5+
-- Copyright (C) 2004 - 2026 JSQLParser
6+
-- %%
7+
-- Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+
-- #L%
9+
---
110
DO $$
211
BEGIN
312
IF NOT EXISTS( select 1 from comm.permission_operation where permission_operation_code = 'ecg_report_time_modify') and EXISTS( select 1 from comm.permission where permission_code = 'data_modify')

0 commit comments

Comments
 (0)