From f4e913aa03294ecacf778fb11fabee986ced3725 Mon Sep 17 00:00:00 2001 From: buraq Date: Thu, 15 Jul 2004 12:33:18 +0000 Subject: out --- test/files/jvm/matching.scala | 74 ------------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 test/files/jvm/matching.scala (limited to 'test/files') diff --git a/test/files/jvm/matching.scala b/test/files/jvm/matching.scala deleted file mode 100644 index 378f1aad44..0000000000 --- a/test/files/jvm/matching.scala +++ /dev/null @@ -1,74 +0,0 @@ -//############################################################################ -// Run Time Bugs & Test Cases -//############################################################################ -// $Id$ - -import java.lang.System; // to avoid name clash with .NET's library - -//############################################################################ -// Test 1 - Runtime Matching creation - -object Test1Test { - import scala.collection.{immutable,Set} ; - import scala.runtime.matching._ ; - case class Foo(i:Int,c:Char,d:List[Foo]) ; - - val t2 = TreeNT(2); - val tr1 = AnyTreeRule( ANYTREE ); - val tr2 = TreeRule( t2, 1, ANYHEDGE ); - val h1 = new HedgeNT(1, true); - val hr1 = HedgeRule( ANYHEDGE, ANYTREE, ANYHEDGE ); - val treeTrans = - new immutable.TreeMap[Int,Set[TRule]]() - .update( 1, immutable.ListSet.Empty[TRule] + tr1 ) - .update( 2, immutable.ListSet.Empty[TRule] + tr2 ); - val hedgeTrans = new immutable.TreeMap[Int,Set[HRule]]() - .update( 1, immutable.ListSet.Empty[HRule] + hr1 ); - - val gram = new Grammar( treeTrans, hedgeTrans, null ) { - val treeInitials = immutable.ListSet.Empty[TreeNT] + t2; - val hedgeInitials = immutable.ListSet.Empty[HedgeNT]; - def test( i:Int, inp:Any ) = { - if( i==1 ) inp.isInstanceOf[List[Int]] else false; - } - } - - def main(args:Array[String]): Unit = - Console.println( new Matcher( gram ).matchesT( List(1,2,3) ).toList ); -} - -//############################################################################ -// Main - -object Test { - var errors: Int = 0; - def test(bug: String, def test: Unit): Unit = { - System.out.println("<<< bug " + bug); - try { - test; - } catch { - case exception => { - val name: String = Thread.currentThread().getName(); - System.out.print("Exception in thread \"" + name + "\" "); - exception.printStackTrace(); - System.out.println(); - errors = errors + 1; - } - } - System.out.println(">>> bug " + bug); - System.out.println(); - } - - def main(args: Array[String]): Unit = { - - test("Test1" , Test1Test.main(args)); - - if (errors > 0) { - System.out.println(); - System.out.println(errors + " error" + (if (errors > 1) "s" else "")); - } - - } -} - -//############################################################################ -- cgit v1.2.3