diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-10-27 13:39:34 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-10-27 13:39:34 +1000 |
commit | e6c8861e154352401632421dc564d60798a7763a (patch) | |
tree | b4c36caba1f13885e450da56334f9e7ed25ec182 /test | |
parent | ba173164c700698d9469bf289b7b40cc11b4262d (diff) | |
parent | 212da3d5be061e235c7ee179a96ffa7b41b7bead (diff) | |
download | scala-e6c8861e154352401632421dc564d60798a7763a.tar.gz scala-e6c8861e154352401632421dc564d60798a7763a.tar.bz2 scala-e6c8861e154352401632421dc564d60798a7763a.zip |
Merge pull request #4818 from som-snytt/issue/4950-tweak
SI-4950 Test reduction
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t4950.check | 7 | ||||
-rw-r--r-- | test/files/run/t4950.scala | 24 |
2 files changed, 18 insertions, 13 deletions
diff --git a/test/files/run/t4950.check b/test/files/run/t4950.check deleted file mode 100644 index 8994441163..0000000000 --- a/test/files/run/t4950.check +++ /dev/null @@ -1,7 +0,0 @@ - -scala> val 1 = 2 -scala.MatchError: 2 (of class java.lang.Integer) - -scala> val List(1) = List(1) - -scala> :quit 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 """ } |