diff options
author | Burak Emir <emir@epfl.ch> | 2007-03-22 03:28:30 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-03-22 03:28:30 +0000 |
commit | c61121a813abaace6e739a6f02e4c85b186f95a1 (patch) | |
tree | 74e4b0b57269397e888424346f674efcd933efc4 /test/files/run/patmatnew.scala | |
parent | 8e890c848ff68e69342d0f340df40f926857c861 (diff) | |
download | scala-c61121a813abaace6e739a6f02e4c85b186f95a1.tar.gz scala-c61121a813abaace6e739a6f02e4c85b186f95a1.tar.bz2 scala-c61121a813abaace6e739a6f02e4c85b186f95a1.zip |
new pattern matching algo
removed "removeoption"
changed SUnit and some tests
added useful debug msg in typer
Diffstat (limited to 'test/files/run/patmatnew.scala')
-rw-r--r-- | test/files/run/patmatnew.scala | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index daa1f9898a..46e980dff0 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -13,20 +13,16 @@ trait Shmeez extends AnyRef with Treez { } } -object Test { - import scala.testing.SUnit._ +import scala.testing.SUnit._ - def main(args:Array[String]): Unit = { - val tr = new TestResult - new TestSuite( +object Test extends TestConsoleMain { + + def suite = new TestSuite( new TestSimpleIntSwitch, new Test717, new TestGuards - ).run(tr) + ) - for(val f <- tr.failures()) - Console println f - } class Foo(j:Int) { case class Bar(i:Int) @@ -130,5 +126,21 @@ object Test { case List(1,2,xs @ _*) => case Nil => } + + def j = (List[Int](), List[Int](1)) match { + case (Nil, _) => 'a' + case (_, Nil) => 'b' + case (h1 :: t1, h2 :: t2) => 'c' + } + + def k (x:AnyRef) = x match { + case null => 1 + case _ => 2 + } + + val FooBar = 42 + def lala() = 42 match { + case FooBar => true + } } |