diff options
author | buraq <buraq@epfl.ch> | 2003-09-26 15:37:26 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-09-26 15:37:26 +0000 |
commit | 419261187e6108607b07e91c9a09821a9bc26ec3 (patch) | |
tree | 0d8050713f0c2638ce0b5c3776f8dde41047dfe3 /test/files/run | |
parent | dc3fd344db8a5ea789e052530de0fa1b28721704 (diff) | |
download | scala-419261187e6108607b07e91c9a09821a9bc26ec3.tar.gz scala-419261187e6108607b07e91c9a09821a9bc26ec3.tar.bz2 scala-419261187e6108607b07e91c9a09821a9bc26ec3.zip |
entered test case for bug132
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/regularpatmat.check | 6 | ||||
-rw-r--r-- | test/files/run/regularpatmat.scala | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check index 97e689710d..cefc159c2c 100644 --- a/test/files/run/regularpatmat.check +++ b/test/files/run/regularpatmat.check @@ -99,3 +99,9 @@ passed ok passed ok passed ok passed ok +testMZ - bug#132 +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 df0d55707f..b9db627de7 100644 --- a/test/files/run/regularpatmat.scala +++ b/test/files/run/regularpatmat.scala @@ -568,6 +568,29 @@ object testWW { } +object testMZ { + import scala.testing.UnitTest.test ; + class Expr; + case class One(xs: List[Expr]) extends Expr; + case class Two() extends Expr; + def testFoo(xs: List[Expr]) = xs match { + case List(Two()?,a,Two()?) => "a = " + a; + case List(Two()*,b,Two()*) => "b = " + b; + case List(_*) => "no match"; + } + + def main:Unit = { + System.out.println("testMZ - bug#132"); + 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"); + () + } + +} + object Test { def main(args: Array[String]): Unit = { testWR.main( args ); @@ -580,6 +603,7 @@ object Test { testBM.main( args ); testBN.main( args ); testBO.main( args ); + testMZ.main; () } } |