simplify boolean: xor (IDEA-92131)

This commit is contained in:
anna
2012-10-19 17:22:27 +02:00
parent ca44510f34
commit 90c6a12e7f
9 changed files with 128 additions and 16 deletions

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = !a; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = !(a ^ b); // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a <caret>^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a <caret>^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ <caret>true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ false ^ b; // expected boolean y1 = a ^ b works correctly;
}

View File

@@ -0,0 +1,9 @@
// "Simplify boolean expression" "true"
class A {
boolean a = true;
boolean b = true;
boolean x = a ^ false; // intention "simplify boolean expression" does nothing here, expected: boolean x = a;
boolean x1 = a ^ true; // expected: boolean x1 = !a; fails, does nothing
boolean y = a ^ true ^ b; // intention replaces with a ^ b, expected !(a ^ b) fails
boolean y1 = a ^ <caret>false ^ b; // expected boolean y1 = a ^ b works correctly;
}