diff options
author | buraq <buraq@epfl.ch> | 2003-10-30 10:49:05 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-30 10:49:05 +0000 |
commit | c48e8b69eb030c8ad0b62ae1b41b64a871af80c7 (patch) | |
tree | 93d6b04fcddcc20e154b9da5e2441337266cb03c /test/files/run/regularpatmat.scala | |
parent | 390da638ae4900d498538c48c7250311fe562ccb (diff) | |
download | scala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.tar.gz scala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.tar.bz2 scala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.zip |
added test case for bug#195
Diffstat (limited to 'test/files/run/regularpatmat.scala')
-rw-r--r-- | test/files/run/regularpatmat.scala | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/files/run/regularpatmat.scala b/test/files/run/regularpatmat.scala index 91cb2be12b..129e325abc 100644 --- a/test/files/run/regularpatmat.scala +++ b/test/files/run/regularpatmat.scala @@ -605,7 +605,16 @@ object testMZ { case _ => "default"; } - def mat(xs: List[Any]) = xs match { // bug#196 + + def mat195(x:Expr) = x match { // bug#195 + case One(x@List(_*)) => + "x = " + x; + + case _ =>"default"; + + } + + def mat196(xs: List[Any]) = xs match { // bug#196 case List(b@(()|())) => "case, b = " + b; @@ -615,7 +624,7 @@ object testMZ { def main:Unit = { - System.out.println("testMZ - bugs #132 #133b #180 #196"); + System.out.println("testMZ - bugs #132 #133b #180 #195 #196"); test[List[Expr],String](testFoo, List(Two(),Two(),Two(),Two()), "b = Two"); test[List[Expr],String](testFoo, List(Two(),Two(),Two()), "a = Two"); test[List[Expr],String](testFoo, List(Two(),Two()), "a = Two"); @@ -628,8 +637,11 @@ object testMZ { test[List[Any],String](testBar, List(On(), On(), On()), "case"); test[List[Any],String](testBar, List(On(), On(), On(), On()), "default"); test[List[Any],String](testBar, List(On(), On(), On(), On(), On()), "default"); - test[List[Any], String](mat, List(1), "default"); - test[List[Any], String](mat, List(), "case, b = List()"); + test[Expr, String](mat195, One(List(Two(),Two())), "x = List(Two,Two)"); + test[Expr, String](mat195, One(List()), "x = List()"); + test[Expr, String](mat195, Two(), "default"); + test[List[Any], String](mat196, List(1), "default"); + test[List[Any], String](mat196, List(), "case, b = List()"); () } |