diff options
author | michelou <michelou@epfl.ch> | 2008-01-23 11:54:50 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-01-23 11:54:50 +0000 |
commit | 2f56eefee4e741e38cfd58d580173a69cfd93deb (patch) | |
tree | 0c12a0dd23e3f2ee0fa2177db2ecd882401083a9 /test/files/run/bug0325.scala | |
parent | fe9a3a692e85149351c4d14cca2e15771b5309f9 (diff) | |
download | scala-2f56eefee4e741e38cfd58d580173a69cfd93deb.tar.gz scala-2f56eefee4e741e38cfd58d580173a69cfd93deb.tar.bz2 scala-2f56eefee4e741e38cfd58d580173a69cfd93deb.zip |
corrected regexp
Diffstat (limited to 'test/files/run/bug0325.scala')
-rw-r--r-- | test/files/run/bug0325.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/files/run/bug0325.scala b/test/files/run/bug0325.scala index 18193ff960..dc05a8d777 100644 --- a/test/files/run/bug0325.scala +++ b/test/files/run/bug0325.scala @@ -2,7 +2,7 @@ case class RS(self: String) { def split(separator: Char): Array[String] = self.split("\\Q"+separator+"\\E") def split(separators: Array[Char]): Array[String] = { - val re = separators.foldLeft("[\\Q")(_+_) + "\\E]" + val re = separators.foldLeft("[")(_+"\\Q"+_+"\\E") + "]" self.split(re) } } @@ -12,9 +12,10 @@ object Test { def test(f: => Array[String], which: String) { try { val ret = f.toList - if (ret != expect) { + if (ret != expect) println(which + " returned " + ret + " when expecting " + expect) - } + else + println(ret) } catch { case e@_ => println(which + " failed with " + e.getClass) } |