summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2003-10-30 10:49:05 +0000
committerburaq <buraq@epfl.ch>2003-10-30 10:49:05 +0000
commitc48e8b69eb030c8ad0b62ae1b41b64a871af80c7 (patch)
tree93d6b04fcddcc20e154b9da5e2441337266cb03c
parent390da638ae4900d498538c48c7250311fe562ccb (diff)
downloadscala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.tar.gz
scala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.tar.bz2
scala-c48e8b69eb030c8ad0b62ae1b41b64a871af80c7.zip
added test case for bug#195
-rw-r--r--test/files/run/regularpatmat.check5
-rw-r--r--test/files/run/regularpatmat.scala20
2 files changed, 20 insertions, 5 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check
index e26ac2ddc3..8957c8aba3 100644
--- a/test/files/run/regularpatmat.check
+++ b/test/files/run/regularpatmat.check
@@ -99,7 +99,10 @@ passed ok
passed ok
passed ok
passed ok
-testMZ - bugs #132 #133b #180 #196
+testMZ - bugs #132 #133b #180 #195 #196
+passed ok
+passed ok
+passed ok
passed ok
passed ok
passed ok
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()");
()
}