diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/regularpatmat.check | 8 | ||||
-rw-r--r-- | test/files/run/regularpatmat.scala | 14 |
2 files changed, 20 insertions, 2 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check index 99ebce5ab5..9363d7baf3 100644 --- a/test/files/run/regularpatmat.check +++ b/test/files/run/regularpatmat.check @@ -99,7 +99,13 @@ passed ok passed ok passed ok passed ok -testMZ - bug#132 bug#133b +testMZ - bugs #132 #133b #180 +passed ok +passed ok +passed ok +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 0b1b6d6085..6a4c0eebfc 100644 --- a/test/files/run/regularpatmat.scala +++ b/test/files/run/regularpatmat.scala @@ -598,15 +598,27 @@ object testMZ { case List(x@(OneN()*), y@(OneN())) => "case"; case _ => "default"; } + case class On(); + case class Tw(); + def testBar(xs: List[Any]) = xs match { + case List(((On(), Tw())* | (On(), On())), On()) => "case" + case _ => "default"; + } def main:Unit = { - System.out.println("testMZ - bug#132 bug#133b"); + System.out.println("testMZ - bugs #132 #133b #180"); 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"); test[List[Expr],String](testFoo, List(Two()), "a = Two"); test[List[Expr],String](testFoo, List(), "no match"); test[List[Any],String](bind, List(OneN(),OneN()), "case"); + test[List[Any],String](testBar, List(), "default"); + test[List[Any],String](testBar, List(On()), "case"); + test[List[Any],String](testBar, List(On(), On()), "default"); + 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"); () } |