Skip to content

Commit 295c114

Browse files
committed
1 parent a838fec commit 295c114

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

src/test/java/net/sf/jsqlparser/parser/CCJSqlParserUtilTest.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
import net.sf.jsqlparser.expression.operators.arithmetic.Addition;
88
import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication;
99
import net.sf.jsqlparser.schema.Column;
10+
import net.sf.jsqlparser.statement.Statements;
1011
import org.junit.After;
1112
import org.junit.AfterClass;
13+
import static org.junit.Assert.*;
1214
import org.junit.Before;
1315
import org.junit.BeforeClass;
1416
import org.junit.Test;
15-
import static org.junit.Assert.*;
1617

1718
/**
1819
*
@@ -61,12 +62,12 @@ public void testParseExpression2() throws Exception {
6162
assertTrue(mult.getLeftExpression() instanceof LongValue);
6263
assertTrue(mult.getRightExpression() instanceof Parenthesis);
6364
}
64-
65+
6566
@Test(expected = JSQLParserException.class)
6667
public void testParseExpressionNonPartial() throws Exception {
6768
Expression result = CCJSqlParserUtil.parseExpression("a+", false);
6869
}
69-
70+
7071
@Test
7172
public void testParseExpressionNonPartial2() throws Exception {
7273
Expression result = CCJSqlParserUtil.parseExpression("a+", true);
@@ -78,28 +79,45 @@ public void testParseCondExpression() throws Exception {
7879
Expression result = CCJSqlParserUtil.parseCondExpression("a+b>5 and c<3");
7980
assertEquals("a + b > 5 AND c < 3", result.toString());
8081
}
81-
82+
8283
@Test
8384
public void testParseCondExpressionNonPartial() throws Exception {
8485
Expression result = CCJSqlParserUtil.parseCondExpression("x=92 and y=29", false);
8586
assertEquals("x = 92 AND y = 29", result.toString());
8687
}
87-
88+
8889
@Test(expected = JSQLParserException.class)
8990
public void testParseCondExpressionNonPartial2() throws Exception {
9091
Expression result = CCJSqlParserUtil.parseCondExpression("x=92 lasd y=29", false);
9192
System.out.println(result.toString());
9293
}
93-
94+
9495
@Test
9596
public void testParseCondExpressionPartial2() throws Exception {
9697
Expression result = CCJSqlParserUtil.parseCondExpression("x=92 lasd y=29", true);
9798
assertEquals("x = 92", result.toString());
9899
}
99-
100+
100101
@Test
101102
public void testParseCondExpressionIssue471() throws Exception {
102103
Expression result = CCJSqlParserUtil.parseCondExpression("(SSN,SSM) IN ('11111111111111', '22222222222222')");
103104
assertEquals("(SSN, SSM) IN ('11111111111111', '22222222222222')", result.toString());
104105
}
106+
107+
@Test
108+
public void testParseStatementsIssue691() throws Exception {
109+
Statements result = CCJSqlParserUtil.parseStatements(
110+
"select * from dual;\n"
111+
+ "\n"
112+
+ "select\n"
113+
+ "*\n"
114+
+ "from\n"
115+
+ "dual;\n"
116+
+ "\n"
117+
+ "select *\n"
118+
+ "from dual;");
119+
assertEquals("SELECT * FROM dual;\n"
120+
+ "SELECT * FROM dual;\n"
121+
+ "SELECT * FROM dual;\n", result.toString());
122+
}
105123
}

0 commit comments

Comments
 (0)