From 8cf870df7bec58d79f3e69249ad5dc05a234ea5c Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Mon, 6 Mar 2000 03:48:33 +0000 Subject: [PATCH] re GNATS java.io/141 (StreamTokenizer doesn't scan mixed token types correctly) 2000-03-05 Anthony Green * libjava.lang/PR141.java: New file. * libjava.lang/PR141.out: New file. For PR java.io/141. From-SVN: r32352 --- libjava/testsuite/ChangeLog | 6 ++++ libjava/testsuite/libjava.lang/PR141.java | 41 +++++++++++++++++++++++ libjava/testsuite/libjava.lang/PR141.out | 8 +++++ 3 files changed, 55 insertions(+) create mode 100644 libjava/testsuite/libjava.lang/PR141.java create mode 100644 libjava/testsuite/libjava.lang/PR141.out diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog index 52367ad6271..8940bfc7c69 100644 --- a/libjava/testsuite/ChangeLog +++ b/libjava/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2000-03-05 Anthony Green + + * libjava.lang/PR141.java: New file. + * libjava.lang/PR141.out: New file. + For PR java.io/141. + 2000-03-05 Anthony Green * libjava.compile/PR129_B.java: New file. diff --git a/libjava/testsuite/libjava.lang/PR141.java b/libjava/testsuite/libjava.lang/PR141.java new file mode 100644 index 00000000000..c3314f2af76 --- /dev/null +++ b/libjava/testsuite/libjava.lang/PR141.java @@ -0,0 +1,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(); + } + } +} diff --git a/libjava/testsuite/libjava.lang/PR141.out b/libjava/testsuite/libjava.lang/PR141.out new file mode 100644 index 00000000000..37cb87c6de2 --- /dev/null +++ b/libjava/testsuite/libjava.lang/PR141.out @@ -0,0 +1,8 @@ +( +[TT_WORD]: a +) +[TT_NUMBER]: 0.0 +( +[TT_WORD]: b +) +[TT_EOF]