1.1 --- a/tests/StringTest.java Sun Jan 23 01:01:34 2005 +0100
1.2 +++ b/tests/StringTest.java Sun Jan 23 01:01:40 2005 +0100
1.3 @@ -2,7 +2,7 @@
1.4 private String s;
1.5 private String s2 = new String("abc");
1.6 private static String s3;
1.7 - private static String s4 = new String("xyz");
1.8 + public static String s4 = new String("xyz");
1.9
1.10 public StringTest() {
1.11 s = s2;
1.12 @@ -15,4 +15,32 @@
1.13 public StringTest(String firstString, String secondString) {
1.14 s = firstString + secondString;
1.15 }
1.16 +
1.17 + public static void main(String[] args) {
1.18 + if (StringTest.s4.equals("xyz")) {
1.19 + System.out.println("StringTest.s4 correct: " + StringTest.s4);
1.20 + } else {
1.21 + System.err.println("StringTest.s4 failed!");
1.22 + }
1.23 + StringTest test0 = new StringTest();
1.24 + if (test0.s.equals("abc")) {
1.25 + System.out.println("test0.s correct: " + test0.s);
1.26 + } else {
1.27 + System.err.println("test0.s failed!");
1.28 + }
1.29 + StringTest test1 = new StringTest("Test");
1.30 + if (test1.s.equals("Test")) {
1.31 + System.out.println("test1.s correct: " + test1.s);
1.32 + } else {
1.33 + System.err.println("test1.s failed!");
1.34 + }
1.35 + StringTest test2 = new StringTest("Hello ", "world");
1.36 + if (test2.s.equals("Hello world")) {
1.37 + System.out.println("test2.s correct: " + test2.s);
1.38 + } else {
1.39 + System.err.println("test2.s failed!");
1.40 + }
1.41 + }
1.42 }
1.43 +
1.44 +// vim: tabstop=4 expandtab shiftwidth=4