From da10615b3f06e1c30dec1e3ca36b4f1ef52682b0 Mon Sep 17 00:00:00 2001 From: buraq Date: Tue, 28 Oct 2003 14:47:36 +0000 Subject: added test case bug180 --- test/files/run/regularpatmat.check | 8 +++++++- test/files/run/regularpatmat.scala | 14 +++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'test') 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"); () } -- cgit v1.2.3