diff options
author | buraq <buraq@epfl.ch> | 2003-10-01 15:03:18 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-10-01 15:03:18 +0000 |
commit | 7449ae53ec7afbc0dcfa7210182a36f93d644f3a (patch) | |
tree | c2c5626af3c57cb3dd3dd154ad3bf58a700d8b54 /test/files | |
parent | 64d947d0e2d93ee4c9bc7f6f661cac293f8a9026 (diff) | |
download | scala-7449ae53ec7afbc0dcfa7210182a36f93d644f3a.tar.gz scala-7449ae53ec7afbc0dcfa7210182a36f93d644f3a.tar.bz2 scala-7449ae53ec7afbc0dcfa7210182a36f93d644f3a.zip |
added testcases for last bugfix (testNN)
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/regularpatmat.check | 5 | ||||
-rw-r--r-- | test/files/run/regularpatmat.scala | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check index cefc159c2c..992ff45a58 100644 --- a/test/files/run/regularpatmat.check +++ b/test/files/run/regularpatmat.check @@ -105,3 +105,8 @@ passed ok passed ok passed ok passed ok +testNN +passed ok +passed ok +passed ok +passed ok diff --git a/test/files/run/regularpatmat.scala b/test/files/run/regularpatmat.scala index b9db627de7..473c4d47c8 100644 --- a/test/files/run/regularpatmat.scala +++ b/test/files/run/regularpatmat.scala @@ -591,6 +591,26 @@ object testMZ { } +object testNN { + import scala.testing.UnitTest._ ; + abstract class K; + case class F(x:K*) extends K; + case class G() extends K; + + def mtch(k:K):boolean = k.match { + case F(F(G()*),G(),F(G()*)) => true; + case _ => false; + } + + def main:Unit = { + System.out.println("testNN"); + test[K,boolean](mtch, F(F(G()),G(),F(G())), true); + test[K,boolean](mtch, F(F(),G(),F(G(),G(),G(),G())), true); + test[K,boolean](mtch, G(), false); + test[K,boolean](mtch, F(G()), false); + } +} + object Test { def main(args: Array[String]): Unit = { testWR.main( args ); @@ -604,6 +624,7 @@ object Test { testBN.main( args ); testBO.main( args ); testMZ.main; + testNN.main; () } } |