From 8c2a69d14e1566a7468a530ccfc2d08608483753 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Mon, 25 Dec 2006 11:30:13 +0000 Subject: unapply <-> as in "Matching with Objects" --- test/files/run/patmatnew.scala | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'test/files/run/patmatnew.scala') diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 377e89a267..10b0021f0f 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -20,8 +20,8 @@ object Test { val tr = new TestResult new TestSuite( - new Test717 - + new Test717, + new TestGuards ).run(tr) for(val f <- tr.failures()) @@ -44,6 +44,22 @@ object Test { } } + class TestGuards extends TestCase("multiple guards for same pattern") with Shmeez { + val tree:Tree = Beez(2) + override def runTest = { + val res = tree match { + case Beez(x) if x == 3 => false + case Beez(x) if x == 2 => true + } + assertTrue("ok", res); + val ret = (Beez(3):Tree) match { + case Beez(x) if x == 3 => true + case Beez(x) if x == 2 => false + } + assertTrue("ok", ret); + } + } + class Test806_818 { // #806, #811 compile only -- type of bind // bug811 trait Core { -- cgit v1.2.3