summaryrefslogtreecommitdiff
path: root/test/files/run/t4950.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t4950.scala')
-rw-r--r--test/files/run/t4950.scala24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/files/run/t4950.scala b/test/files/run/t4950.scala
index cef06027bf..e34b2cf3f2 100644
--- a/test/files/run/t4950.scala
+++ b/test/files/run/t4950.scala
@@ -1,12 +1,24 @@
-import scala.tools.partest.ReplTest
+import scala.tools.partest.SessionTest
+import scala.PartialFunction.{ cond => when }
+
+object Elision {
+ val elideMsg = """ ... \d+ elided""".r
+}
+
+object Test extends SessionTest {
+ import Elision._
-object Test extends ReplTest {
// Filter out the abbreviated stacktrace "... X elided"
// because the number seems to differ between versions/platforms/...
- override def show = eval() filterNot (_ contains "elided") foreach println
- def code =
+ def elided(s: String) = when(s) { case elideMsg() => true }
+ override def eval() = super.eval() filterNot elided
+ def session =
"""
-val 1 = 2
-val List(1) = List(1)
+scala> val 1 = 2
+scala.MatchError: 2 (of class java.lang.Integer)
+
+scala> val List(1) = List(1)
+
+scala> :quit
"""
}