Skip to content

Commit

Permalink
added two more cases for BooleanSimplication
Browse files Browse the repository at this point in the history
  • Loading branch information
gatorsmile committed Dec 12, 2015
1 parent 79be2c3 commit 2ff70bf
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,27 @@ class BooleanSimplificationSuite extends PlanTest with PredicateHelper {

checkCondition(
('a === 'b || 'b > 3) && ('a === 'b || 'a > 3) && ('a === 'b || 'a < 5),
('a === 'b || 'b > 3 && 'a > 3 && 'a < 5))
'a === 'b || 'b > 3 && 'a > 3 && 'a < 5)
}

test("a && (!a || b)") {
checkCondition(('a && (!('a) || 'b )), ('a && 'b))
checkCondition('a && (!'a || 'b ), 'a && 'b)

checkCondition(('a && ('b || !('a) )), ('a && 'b))
checkCondition('a && ('b || !'a ), 'a && 'b)

checkCondition(((!('a) || 'b ) && 'a), ('b && 'a))
checkCondition((!'a || 'b ) && 'a, 'b && 'a)

checkCondition((('b || !('a) ) && 'a), ('b && 'a))
checkCondition(('b || !'a ) && 'a, 'b && 'a)
}

test("!(a && b) , !(a || b)") {
checkCondition((!('a && 'b)), (!('a) || !('b)))
checkCondition(!('a && 'b), !'a || !'b)

checkCondition(!('a || 'b), (!('a) && !('b)))
checkCondition(!('a || 'b), !'a && !'b)

checkCondition(!(('a && 'b) || ('c && 'd)), (!'a || !'b) && (!'c || !'d))

checkCondition(!(('a || 'b) && ('c || 'd)), (!'a && !'b) || (!'c && !'d))
}

private val caseInsensitiveAnalyzer =
Expand Down

0 comments on commit 2ff70bf

Please sign in to comment.