diff options
author | buraq <buraq@epfl.ch> | 2003-10-28 14:47:36 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-28 14:47:36 +0000 |
commit | da10615b3f06e1c30dec1e3ca36b4f1ef52682b0 (patch) | |
tree | c0493d3ac7f6e00c457552235944e7953406eb9d | |
parent | 6502b10931983e21dfe6da0d13c6245dd2a7e691 (diff) | |
download | scala-da10615b3f06e1c30dec1e3ca36b4f1ef52682b0.tar.gz scala-da10615b3f06e1c30dec1e3ca36b4f1ef52682b0.tar.bz2 scala-da10615b3f06e1c30dec1e3ca36b4f1ef52682b0.zip |
added test case bug180
-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"); () } |