From a2267a3540a26d2e5387a702d10bb63578f17dff Mon Sep 17 00:00:00 2001 From: Richard North Date: Sun, 4 Aug 2019 14:27:50 +0100 Subject: [PATCH] Add test to demonstrate that #1452 is no longer an issue (probably fixed by #1627) --- .../testcontainers/ext/ScriptSplittingTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/database-commons/src/test/java/org/testcontainers/ext/ScriptSplittingTest.java b/modules/database-commons/src/test/java/org/testcontainers/ext/ScriptSplittingTest.java index 0836592b91e..202a3b995db 100644 --- a/modules/database-commons/src/test/java/org/testcontainers/ext/ScriptSplittingTest.java +++ b/modules/database-commons/src/test/java/org/testcontainers/ext/ScriptSplittingTest.java @@ -281,6 +281,21 @@ public void testUnclosedBlockComment() { } } + @Test + public void testIssue1452Case() { + String script = "create table test (text VARCHAR(255));\n" + + "\n" + + "/* some comment */\n" + + "insert into `test` (`text`) values ('a b');"; + + List expected = asList( + "create table test (text VARCHAR(255))", + "insert into `test` (`text`) values ('a b')" + ); + + splitAndCompare(script, expected); + } + private void splitAndCompare(String script, List expected) { final List statements = doSplit(script); Assertions.assertThat(statements).isEqualTo(expected);