Skip to content

Commit 1eab6f0

Browse files
test: add test for breaking the parser
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com> Signed-off-by: manticore-projects <andreas@manticore-projects.com>
1 parent fea1425 commit 1eab6f0

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ dependencies {
107107
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:+'
108108

109109
// Java Doc in XML Format
110-
xmlDoclet 'com.manticore-projects.tools:xml-doclet:+'
110+
xmlDoclet 'com.manticore-projects.tools:xml-doclet:1.+'
111111

112112
// enforce latest version of JavaCC
113113
testImplementation 'net.java.dev.javacc:javacc:+'
@@ -130,10 +130,6 @@ java {
130130
}
131131
}
132132

133-
compileJava {
134-
options.release = 11
135-
}
136-
137133
javadoc {
138134
include("build/generated/javacc/net/sf/jsqlparser/parser/*.java" )
139135
if(JavaVersion.current().isJava9Compatible()) {
@@ -184,13 +180,16 @@ tasks.register('xmldoc', Javadoc) {
184180
}
185181

186182
test {
187-
environment = [ 'EXPORT_TEST_TO_FILE': 'True' ]
183+
environment = [ 'EXPORT_TEST_TO_FILE': 'False' ]
188184
useJUnitPlatform()
189185

190186
// set heap size for the test JVM(s)
191187
minHeapSize = "128m"
192188
maxHeapSize = "4G"
193189

190+
// set JVM stack size
191+
jvmArgs = ['-Xss2m']
192+
194193
jacoco {
195194
excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager']
196195
}

src/test/java/net/sf/jsqlparser/statement/select/NestedBracketsPerformanceTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,4 +535,15 @@ void testIssue1983() throws JSQLParserException {
535535
.withAllowComplexParsing(true)
536536
.withTimeOut(60000));
537537
}
538+
539+
@Test
540+
@Disabled
541+
// see https://github.com/javacc/javacc/issues/296
542+
void testIssue2140() throws JSQLParserException {
543+
String sqlStr = "(((IIF((CASE WHEN 1 = 2 THEN 'a' ELSE 'b') = 'b'), 2, 3)))";
544+
545+
CCJSqlParserUtil.parseExpression(
546+
sqlStr, true, parser -> parser
547+
.withTimeOut(10000));
548+
}
538549
}

0 commit comments

Comments
 (0)