sandbox/old-modules/hintsimpl/test/unit/src/org/netbeans/modules/jackpot30/hintsimpl/wrong-string-comparison.test
1.1 --- a/sandbox/old-modules/hintsimpl/test/unit/src/org/netbeans/modules/jackpot30/hintsimpl/wrong-string-comparison.test Mon Dec 19 11:37:36 2016 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,56 +0,0 @@
1.4 -%%TestCase simple
1.5 -package test;
1.6 -public class Test {
1.7 - public static boolean get(String s1, String s2) {
1.8 - return s1 == s2;
1.9 - }
1.10 -}
1.11 -%%=>
1.12 -package test;
1.13 -public class Test {
1.14 - public static boolean get(String s1, String s2) {
1.15 - return s1 == null ? s2 == null : s1.equals(s2);
1.16 - }
1.17 -}
1.18 -%%=>
1.19 -package test;
1.20 -public class Test {
1.21 - public static boolean get(String s1, String s2) {
1.22 - return s1.equals(s2);
1.23 - }
1.24 -}
1.25 -%%TestCase neg
1.26 -package test;
1.27 -public class Test {
1.28 - public static boolean get(String s1, String s2) {
1.29 - return s1 != s2;
1.30 - }
1.31 -}
1.32 -%%=>
1.33 -package test;
1.34 -public class Test {
1.35 - public static boolean get(String s1, String s2) {
1.36 - return !(s1 == null ? s2 == null : s1.equals(s2));
1.37 - }
1.38 -}
1.39 -%%=>
1.40 -package test;
1.41 -public class Test {
1.42 - public static boolean get(String s1, String s2) {
1.43 - return !s1.equals(s2);
1.44 - }
1.45 -}
1.46 -%%TestCase neg-accept
1.47 -package test;
1.48 -public class Test {
1.49 - public static boolean get(String s1, String s2) {
1.50 - return s1 != s2 && (s1 == null || s1.equals(s2));
1.51 - }
1.52 -}
1.53 -%%TestCase null
1.54 -package test;
1.55 -public class Test {
1.56 - public static boolean get(String s1, String s2) {
1.57 - return s1 == null;
1.58 - }
1.59 -}