diff options
author | Burak Emir <emir@epfl.ch> | 2006-09-01 13:54:38 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-09-01 13:54:38 +0000 |
commit | fe5b7a11c51c6536354be0c0c9905422e2e5e0a3 (patch) | |
tree | 82ce708a8fc1129a5753a8daf2da5efdbc02eabe /test/files | |
parent | def54abfbdcd86224920b951e8b8990bcbcfc04c (diff) | |
download | scala-fe5b7a11c51c6536354be0c0c9905422e2e5e0a3.tar.gz scala-fe5b7a11c51c6536354be0c0c9905422e2e5e0a3.tar.bz2 scala-fe5b7a11c51c6536354be0c0c9905422e2e5e0a3.zip |
test case for 717
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/patmatnew.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala new file mode 100644 index 0000000000..965b5a65ce --- /dev/null +++ b/test/files/run/patmatnew.scala @@ -0,0 +1,31 @@ +object Test { + import scala.testing.SUnit._ + + def main(args:Array[String]): Unit = { + val tr = new TestResult + new TestSuite( + + new Test01 + + ).run(tr) + + for(val f <- tr.failures()) + Console println f + } + + class Foo(j:Int) { + case class Bar(i:Int) + } + class Test01 extends TestCase("bir (#717 test path of case classes)") { + val foo1 = new Foo(1) + val foo2 = new Foo(2) + + override def runTest() = { + val res = (foo1.Bar(2):Any) match { + case foo2.Bar(2) => false + case foo1.Bar(2) => true + } + assertTrue("ok", res); + } + } +} |