diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
commit | b6778be91900b8161e705dc2598ef7af86842b0b (patch) | |
tree | d15e8ec18a37eec212f50f1ace27714d7e7d4d34 /test/files/jvm/xml01.scala | |
parent | ac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff) | |
download | scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2 scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip |
Begone t1737...
Diffstat (limited to 'test/files/jvm/xml01.scala')
-rw-r--r-- | test/files/jvm/xml01.scala | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala index ef320e218b..2fab650637 100644 --- a/test/files/jvm/xml01.scala +++ b/test/files/jvm/xml01.scala @@ -16,7 +16,7 @@ object Test extends App { val c = new Node { def label = "hello" - override def hashCode() = + override def hashCode() = Utility.hashCode(prefix, label, attributes.hashCode(), scope.hashCode(), child); def child = Elem(null, "world", e, sc); //def attributes = e; @@ -35,8 +35,8 @@ object Test extends App { val x2p = XML.load(i) assert(x2p == Elem(null, "book" , e, sc, - Elem(null, "author", e, sc,Text("Peter Buneman")), - Elem(null, "author", e, sc,Text("Dan Suciu")), + Elem(null, "author", e, sc,Text("Peter Buneman")), + Elem(null, "author", e, sc,Text("Dan Suciu")), Elem(null, "title" , e, sc,Text("Data on ze web")))) val xmlFile2 = "<bib><book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book><book><author>John Mitchell</author><title>Foundations of Programming Languages</title></book></bib>"; @@ -49,11 +49,11 @@ object Test extends App { assert(parsedxml1 \ "world" sameElements List(Elem(null,"world", e, sc))) - assert( + assert( (parsedxml2 \ "_") sameElements List( Elem(null,"book", e, sc, - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), Elem(null,"title" , e, sc, Text("Data on ze web"))), Elem(null,"book",e,sc, Elem(null,"author",e,sc,Text("John Mitchell")), @@ -61,11 +61,11 @@ object Test extends App { ) assert((parsedxml2 \ "author").isEmpty) - assert( + assert( (parsedxml2 \ "book") sameElements List( Elem(null,"book",e,sc, - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), Elem(null,"title" , e, sc, Text("Data on ze web"))), Elem(null,"book",e,sc, Elem(null,"author", e, sc, Text("John Mitchell")), @@ -73,20 +73,20 @@ object Test extends App { ) ) - assert( + assert( (parsedxml2 \ "_" \ "_") sameElements List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), Elem(null,"title" , e, sc, Text("Data on ze web")), Elem(null,"author", e, sc, Text("John Mitchell")), Elem(null,"title" , e, sc, Text("Foundations of Programming Languages")) ) ) - assert( + assert( (parsedxml2 \ "_" \ "author") sameElements List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), Elem(null,"author", e, sc, Text("John Mitchell")) ) ) @@ -95,15 +95,15 @@ object Test extends App { Console.println("xpath \\\\ DESCENDANTS"); - assert( + assert( (parsedxml2 \\ "author") sameElements List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), Elem(null,"author", e, sc, Text("John Mitchell")) ) ) - assert( + assert( (parsedxml2 \\ "title") sameElements List( Elem(null,"title", e, sc, Text("Data on ze web")), Elem(null,"title", e, sc, Text("Foundations of Programming Languages"))) @@ -114,19 +114,19 @@ object Test extends App { (parsedxml2 \\ "book" ){ n:Node => (n \ "title") xml_== "Data on ze web" } ) - assert( + assert( ((new NodeSeq { val theSeq = List( parsedxml2 ) }) \\ "_") sameElements List( Elem(null,"bib",e,sc, Elem(null,"book",e,sc, - Elem(null, "author", e, sc, Text("Peter Buneman")), - Elem(null, "author", e, sc, Text("Dan Suciu")), + Elem(null, "author", e, sc, Text("Peter Buneman")), + Elem(null, "author", e, sc, Text("Dan Suciu")), Elem(null, "title" , e, sc, Text("Data on ze web"))), Elem(null,"book",e,sc, Elem(null,"author",e,sc,Text("John Mitchell")), Elem(null,"title",e,sc,Text("Foundations of Programming Languages")))), Elem(null,"book",e,sc, - Elem(null,"author",e,sc,Text("Peter Buneman")), - Elem(null,"author",e,sc,Text("Dan Suciu")), + Elem(null,"author",e,sc,Text("Peter Buneman")), + Elem(null,"author",e,sc,Text("Dan Suciu")), Elem(null,"title",e,sc,Text("Data on ze web"))), Elem(null,"author",e,sc,Text("Peter Buneman")), Elem(null,"author",e,sc,Text("Dan Suciu")), |