diff options
author | Miles Sabin <miles@milessabin.com> | 2009-02-03 17:34:15 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2009-02-03 17:34:15 +0000 |
commit | b2e6ac77472114ee59598ce6c2ef6416db6130bd (patch) | |
tree | 8a203a9c5d956e61659da8024bf18510319f7a1b /test/files | |
parent | 3f70dea914b62447e5280d68cf83b1eb6dbbb22b (diff) | |
download | scala-b2e6ac77472114ee59598ce6c2ef6416db6130bd.tar.gz scala-b2e6ac77472114ee59598ce6c2ef6416db6130bd.tar.bz2 scala-b2e6ac77472114ee59598ce6c2ef6416db6130bd.zip |
Fix and test for #1689.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/jtptest.check | 7 | ||||
-rw-r--r-- | test/files/run/jtptest.scala | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/jtptest.check b/test/files/run/jtptest.check new file mode 100644 index 0000000000..95dbd28437 --- /dev/null +++ b/test/files/run/jtptest.check @@ -0,0 +1,7 @@ +[1.4] parsed: 1.1 +[1.3] parsed: 1. +[1.3] parsed: .1 +[1.1] failure: string matching regex `(\d+(\.\d*)?|\d*\.\d+)' expected but `!' found + +!1 +^ diff --git a/test/files/run/jtptest.scala b/test/files/run/jtptest.scala new file mode 100644 index 0000000000..4d0eef9153 --- /dev/null +++ b/test/files/run/jtptest.scala @@ -0,0 +1,17 @@ + +import scala.util.parsing.combinator.JavaTokenParsers +import scala.util.parsing.input.CharArrayReader + +object TestJavaTokenParsers extends JavaTokenParsers { +} + +object Test { + import TestJavaTokenParsers._ + + def main(args : Array[String]) { + println(decimalNumber(new CharArrayReader("1.1".toCharArray))) + println(decimalNumber(new CharArrayReader("1.".toCharArray))) + println(decimalNumber(new CharArrayReader(".1".toCharArray))) + println(decimalNumber(new CharArrayReader("!1".toCharArray))) + } +} |