summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2003-10-29 14:24:37 +0000
committerburaq <buraq@epfl.ch>2003-10-29 14:24:37 +0000
commit05e2b718cd6ec1a375df4c51107f06c1d6dd74b6 (patch)
tree7f2f7f2b3445d3a2cfb0358e24875855419a5208 /test
parentb0cd565a51d819847de0691fe5f9098fd17dce71 (diff)
downloadscala-05e2b718cd6ec1a375df4c51107f06c1d6dd74b6.tar.gz
scala-05e2b718cd6ec1a375df4c51107f06c1d6dd74b6.tar.bz2
scala-05e2b718cd6ec1a375df4c51107f06c1d6dd74b6.zip
added test case for bug196
Diffstat (limited to 'test')
-rw-r--r--test/files/run/regularpatmat.check4
-rw-r--r--test/files/run/regularpatmat.scala13
2 files changed, 15 insertions, 2 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check
index 9363d7baf3..e26ac2ddc3 100644
--- a/test/files/run/regularpatmat.check
+++ b/test/files/run/regularpatmat.check
@@ -99,7 +99,9 @@ passed ok
passed ok
passed ok
passed ok
-testMZ - bugs #132 #133b #180
+testMZ - bugs #132 #133b #180 #196
+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 6e964b8f13..91cb2be12b 100644
--- a/test/files/run/regularpatmat.scala
+++ b/test/files/run/regularpatmat.scala
@@ -605,8 +605,17 @@ object testMZ {
case _ => "default";
}
+ def mat(xs: List[Any]) = xs match { // bug#196
+ case List(b@(()|())) =>
+ "case, b = " + b;
+
+ case _ =>"default";
+
+ }
+
+
def main:Unit = {
- System.out.println("testMZ - bugs #132 #133b #180");
+ System.out.println("testMZ - bugs #132 #133b #180 #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");
@@ -619,6 +628,8 @@ 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()");
()
}