From d4e3c78e738e37a0ba5fa5eb8b5196a8556d2c53 Mon Sep 17 00:00:00 2001 From: buraq Date: Fri, 25 Jun 2004 17:29:50 +0000 Subject: namespaces --- test/files/jvm/xmlstuff.scala | 52 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'test/files/jvm/xmlstuff.scala') diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index 2617110372..f05548aa96 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -6,7 +6,7 @@ import scala.xml.{Node,NodeSeq,Elem,Text}; object Test with Application { - val e = scala.collection.immutable.TreeMap.Empty[String,String]; + val e = Node.NoAttributes; /* def eq( a:Seq[Node], b:Seq[Node] ):boolean = { @@ -30,7 +30,7 @@ object Test with Application { def label = "hello"; def namespace = ""; def child = List(Elem("","world",e)); - def attribute = e; + def attributes = e; }; assertSameElements( List( 3 ), List( 3 )); @@ -274,5 +274,53 @@ val addrBook = )); + /* patterns */ + Console.println("patterns"); + assertEquals( match { case => true; case _ => false; }, + true); + + assertEquals( + + + match { case + + => true; + case _ => false; }, + true); + + assertEquals( + + crazy text world + match { case + crazy text world + => true; + case _ => false; }, + true); + + /* namespaces */ + Console.println("namespaces"); + val cuckoo = + + + ; + assertEquals( cuckoo.namespace, "http://cuckoo.com"); + for( val n <- cuckoo.child ) { + assertEquals( n.namespace, "http://cuckoo.com"); + } + + /* + assertEquals( true, cuckoo match { + case + + + => true; + case _ => false; }); +*/ + assertEquals( false, cuckoo match { + case + + + => true; + case _ => false; }); } -- cgit v1.2.3