diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/020-string/expected.txt | 2 | ||||
| -rw-r--r-- | test/020-string/src/Main.java | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/test/020-string/expected.txt b/test/020-string/expected.txt index 76b8929bd7..83a0835718 100644 --- a/test/020-string/expected.txt +++ b/test/020-string/expected.txt @@ -1,6 +1,6 @@ testStr is 'This is a very nice string' This is a very nice string -Compare result is 32 +Compare result is greater than zero Compare unicode: -65302 Got expected exception subStr is 'uick brown fox jumps over the lazy ' diff --git a/test/020-string/src/Main.java b/test/020-string/src/Main.java index 710808255c..ccf94aabcc 100644 --- a/test/020-string/src/Main.java +++ b/test/020-string/src/Main.java @@ -45,7 +45,14 @@ public class Main { if (testStr.length() != testStr2.length()) System.out.println("WARNING: stringTest length mismatch"); - System.out.println("Compare result is " + testStr.compareTo(testStr2)); + int compareResult = testStr.compareTo(testStr2); + if (compareResult > 0) { + System.out.println("Compare result is greater than zero"); + } else if (compareResult == 0) { + System.out.println("Compare result is equal to zero"); + } else { + System.out.println("Compare result is less than zero"); + } // expected: -65302 String s1 = "\u0c6d\u0cb6\u0d00\u0000\u0080\u0080\u0080\u0000\u0002\u0002\u0002\u0000\u00e9\u00e9\u00e9"; |