Patch: more test code

Anthony Green green@cygnus.com
Sun Mar 5 19:47:00 GMT 2000


I'm committing the following test code from Jeff Sturm:

2000-03-05  Anthony Green  <green@redhat.com>

	* libjava.lang/PR141.java: New file.
	* libjava.lang/PR141.out: New file.
	For PR java.io/141.


Index: libjava/testsuite/libjava.lang/PR141.java
===================================================================
RCS file: PR141.java
diff -N PR141.java
0a1,41
> import java.io.IOException;
> import java.io.StreamTokenizer;
> import java.io.StringReader;
> 
> public class PR141 {
>   public static void test(String str) throws IOException {
>     StringReader reader = new StringReader(str);
>     StreamTokenizer st = new StreamTokenizer(reader);
>     int t = 0;
>     
>     do {
>       t = st.nextToken();
>       
>       switch (t) {
>       case StreamTokenizer.TT_WORD:
> 	System.out.println("[TT_WORD]: " + st.sval);
> 	break;
>       case StreamTokenizer.TT_NUMBER:
> 	System.out.println("[TT_NUMBER]: " + st.nval);
> 	break;
>       case StreamTokenizer.TT_EOL:
> 	System.out.println("[TT_EOL]");
> 	break;
>       case StreamTokenizer.TT_EOF:
> 	System.out.println("[TT_EOF]");
> 	break;
>       default:
> 	System.out.println((char)t);
> 	break;
>       }
>     } while (t != StreamTokenizer.TT_EOF);
>   }
>   
>   public static void main(String[] args) {
>     try {
>       test("(a).(b)");
>     } catch (Throwable t) {
>       t.printStackTrace();
>     }
>   }
> }
Index: libjava/testsuite/libjava.lang/PR141.out
===================================================================
RCS file: PR141.out
diff -N PR141.out
0a1,8
> (
> [TT_WORD]: a
> )
> [TT_NUMBER]: 0.0
> (
> [TT_WORD]: b
> )
> [TT_EOF]

-- 
Anthony Green                                                        Red Hat
                                                       Sunnyvale, California


More information about the Java-patches mailing list