Skip to content

Commit

Permalink
corrected a last minute bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wumpz committed Jul 9, 2022
1 parent 48ea0e2 commit 8378ea4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static java.util.stream.Collectors.toList;
import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.Parenthesis;
import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -31,15 +32,15 @@ public class CloneHelperTest {
public void testChangeBack() {
MultipleExpression ors = transform( Arrays.asList("a>b", "5=a", "b=c", "a>c"));
Expression expr = CloneHelper.changeBack(true, ors);
assertThat(expr).isInstanceOf(OrExpression.class);
assertThat(expr).isInstanceOf(Parenthesis.class);
assertThat(expr.toString()).isEqualTo("a > b OR 5 = a OR b = c OR a > c");
}

@Test
public void testChangeBackOddNumberOfExpressions() {
MultipleExpression ors = transform( Arrays.asList("a>b", "5=a", "b=c", "a>c", "e<f"));
Expression expr = CloneHelper.changeBack(true, ors);
assertThat(expr).isInstanceOf(OrExpression.class);
assertThat(expr).isInstanceOf(Parenthesis.class);
assertThat(expr.toString()).isEqualTo("a > b OR 5 = a OR b = c OR a > c OR e < f");
}

Expand Down

0 comments on commit 8378ea4

Please sign in to comment.