diff options
author | buraq <buraq@epfl.ch> | 2004-06-08 18:06:10 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2004-06-08 18:06:10 +0000 |
commit | 4a3559d00506505a2eb571c92b263cf5b080a669 (patch) | |
tree | 01ba34c63a24c2deaca2515b2bc43ffbd23b53d2 /test/files/jvm/xmlstuff.scala | |
parent | 2c7b4a9d136c53011d65d46893fddc754e6231d9 (diff) | |
download | scala-4a3559d00506505a2eb571c92b263cf5b080a669.tar.gz scala-4a3559d00506505a2eb571c92b263cf5b080a669.tar.bz2 scala-4a3559d00506505a2eb571c92b263cf5b080a669.zip |
xml changes - nodeseq supports comprehension, p...
xml changes - nodeseq supports comprehension, prettyprinter.format
Diffstat (limited to 'test/files/jvm/xmlstuff.scala')
-rw-r--r-- | test/files/jvm/xmlstuff.scala | 39 |
1 files changed, 37 insertions, 2 deletions
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 = + <bks> + <book><title>Blabla</title></book> + <book><title>Blubabla</title></book> + <book><title>Baaaaaaalabla</title></book> + </bks>; + + val reviews = + <reviews> + <entry><title>Blabla</title> + <remarks> + Hallo Welt. + </remarks> + </entry> + <entry><title>Blubabla</title> + <remarks> + Hello Blu + </remarks> + </entry> + <entry><title>Blubabla</title> + <remarks> + rem 2 + </remarks> + </entry> + </reviews>; + + Console.println( new scala.xml.PrettyPrinter(80, 5).format ( + for( val t <- books \\ "title"; + val r <- reviews \\ "entry"; r \ "title" == t ) yield + <result> + { t } + { r } + </result> + )); } |