From c48e8b69eb030c8ad0b62ae1b41b64a871af80c7 Mon Sep 17 00:00:00 2001 From: buraq Date: Thu, 30 Oct 2003 10:49:05 +0000 Subject: added test case for bug#195 --- test/files/run/regularpatmat.check | 5 ++++- test/files/run/regularpatmat.scala | 20 ++++++++++++++++---- 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()"); () } -- cgit v1.2.3