From ff389f693c06fb5db50c17b8d7d3c7a3b505420f Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Thu, 7 Sep 2006 16:54:57 +0000 Subject: xml changes --- test/files/jvm/xml02.scala | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/files/jvm/xml02.scala (limited to 'test/files/jvm/xml02.scala') diff --git a/test/files/jvm/xml02.scala b/test/files/jvm/xml02.scala new file mode 100644 index 0000000000..cbc9b5041b --- /dev/null +++ b/test/files/jvm/xml02.scala @@ -0,0 +1,55 @@ +object Test { +def main(args:Array[String]) = { + import scala.xml.NodeSeq + import NodeSeq.view + import testing.UnitTest._ + + + val ax = + + + + Console.println("attributes"); + + Console.println("one"); + assertEquals(ax \ "@foo", "bar") + Console.println("two"); + assertEquals(ax \ "@foo", xml.Text("bar")) + + val bx = + + Console.println("three"); + assertEquals(bx \ "@foo", "bar&x") + Console.println("four"); + assertSameElements(bx \ "@foo", List(xml.Text("bar"),xml.EntityRef("amp"),xml.Text("x"))) + + Console.println("five"); + assertEquals(bx.toString, "") + + + /* patterns */ + Console.println("patterns"); + assertEquals( match { case => true; case _ => false; }, + true); + + + + /* + assertEquals(ax match { case x @ + + if x \ "@foo" == "bar" => true; + case _ => false; }, + true); + + assertEquals( + + crazy text world + match { case + crazy text world + => true; + case _ => false; }, + true); + */ +} + +} -- cgit v1.2.3