From 4a3559d00506505a2eb571c92b263cf5b080a669 Mon Sep 17 00:00:00 2001 From: buraq Date: Tue, 8 Jun 2004 18:06:10 +0000 Subject: xml changes - nodeseq supports comprehension, p... xml changes - nodeseq supports comprehension, prettyprinter.format --- test/files/jvm/xmlLiterals.scala | 2 +- test/files/jvm/xmlstuff.check | 19 +++++++++++++++++++ test/files/jvm/xmlstuff.scala | 39 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 3 deletions(-) (limited to 'test/files/jvm') diff --git a/test/files/jvm/xmlLiterals.scala b/test/files/jvm/xmlLiterals.scala index c45f2a1cd5..13b2591790 100644 --- a/test/files/jvm/xmlLiterals.scala +++ b/test/files/jvm/xmlLiterals.scala @@ -221,7 +221,7 @@ object Test03Servlet { def main( args:Array[String] ) = { val x = doGetXML(); Console.println( x ); - Console.println( new PrettyPrinter( 80, 2 ).toPrettyXML( x )); + Console.println( new PrettyPrinter( 80, 2 ).format( x )); } } diff --git a/test/files/jvm/xmlstuff.check b/test/files/jvm/xmlstuff.check index afe3a6839f..f73797cb2a 100644 --- a/test/files/jvm/xmlstuff.check +++ b/test/files/jvm/xmlstuff.check @@ -20,3 +20,22 @@ passed ok passed ok NodeSeq passed ok + + Blabla + + Blabla + Hallo Welt. + + + Blubabla + + Blubabla + Hello Blu + + + Blubabla + + Blubabla + rem 2 + + diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index ff6c2e03ed..3954f6f383 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -138,7 +138,7 @@ object Test with Application { ); - assertSameElements( + assertEquals( new NodeSeq(List( parsedxml2 )) \\ "_", @@ -192,6 +192,41 @@ object Test with Application { x.attribute("value") + y.attribute("bazValue")+ "!" }, new NodeSeq(List(Text("38!"),Text("58!"))) - ) + ); + + val books = + + Blabla + Blubabla + Baaaaaaalabla + ; + + val reviews = + + Blabla + + Hallo Welt. + + + Blubabla + + Hello Blu + + + Blubabla + + rem 2 + + + ; + + Console.println( new scala.xml.PrettyPrinter(80, 5).format ( + for( val t <- books \\ "title"; + val r <- reviews \\ "entry"; r \ "title" == t ) yield + + { t } + { r } + + )); } -- cgit v1.2.3