Skip to content

Commit

Permalink
test: add test for breaking the parser
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
Signed-off-by: manticore-projects <andreas@manticore-projects.com>
  • Loading branch information
manticore-projects committed Jan 11, 2025
1 parent fea1425 commit 1eab6f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ dependencies {
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:+'

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

// enforce latest version of JavaCC
testImplementation 'net.java.dev.javacc:javacc:+'
Expand All @@ -130,10 +130,6 @@ java {
}
}

compileJava {
options.release = 11
}

javadoc {
include("build/generated/javacc/net/sf/jsqlparser/parser/*.java" )
if(JavaVersion.current().isJava9Compatible()) {
Expand Down Expand Up @@ -184,13 +180,16 @@ tasks.register('xmldoc', Javadoc) {
}

test {
environment = [ 'EXPORT_TEST_TO_FILE': 'True' ]
environment = [ 'EXPORT_TEST_TO_FILE': 'False' ]
useJUnitPlatform()

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

// set JVM stack size
jvmArgs = ['-Xss2m']

jacoco {
excludes = ['net/sf/jsqlparser/parser/CCJSqlParserTokenManager']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,15 @@ void testIssue1983() throws JSQLParserException {
.withAllowComplexParsing(true)
.withTimeOut(60000));
}

@Test
@Disabled
// see /~https://github.com/javacc/javacc/issues/296
void testIssue2140() throws JSQLParserException {
String sqlStr = "(((IIF((CASE WHEN 1 = 2 THEN 'a' ELSE 'b') = 'b'), 2, 3)))";

CCJSqlParserUtil.parseExpression(
sqlStr, true, parser -> parser
.withTimeOut(10000));
}
}

0 comments on commit 1eab6f0

Please sign in to comment.