Skip to content

Commit b1cb06d

Browse files
authored
Add test to demonstrate fix for #1452 (loss of whitespace in sp… (#1702)
(probably fixed by #1627)
1 parent 4fbef4b commit b1cb06d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

modules/database-commons/src/test/java/org/testcontainers/ext/ScriptSplittingTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,21 @@ public void testUnclosedBlockComment() {
281281
}
282282
}
283283

284+
@Test
285+
public void testIssue1452Case() {
286+
String script = "create table test (text VARCHAR(255));\n" +
287+
"\n" +
288+
"/* some comment */\n" +
289+
"insert into `test` (`text`) values ('a b');";
290+
291+
List<String> expected = asList(
292+
"create table test (text VARCHAR(255))",
293+
"insert into `test` (`text`) values ('a b')"
294+
);
295+
296+
splitAndCompare(script, expected);
297+
}
298+
284299
private void splitAndCompare(String script, List<String> expected) {
285300
final List<String> statements = doSplit(script);
286301
Assertions.assertThat(statements).isEqualTo(expected);

0 commit comments

Comments
 (0)