From 90b93c790c6687ae34d3519f4b1fb6dd91007e9f Mon Sep 17 00:00:00 2001 From: michelou Date: Wed, 9 Nov 2005 10:00:35 +0000 Subject: - removed illegal code. --- test/files/jvm/xml01.scala | 75 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'test/files/jvm') diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala index 4faa9fccad..a0ea59408c 100644 --- a/test/files/jvm/xml01.scala +++ b/test/files/jvm/xml01.scala @@ -10,18 +10,17 @@ object Test { val e: scala.xml.MetaData = Null; //Node.NoAttributes; val sc: scala.xml.NamespaceBinding = TopScope; - val xmlFile1 = ""; - val isrc1 = new InputSource( new StringReader( xmlFile1 ) ); - val parsedxml1 = XML.load( isrc1 ); - val isrc11 = new InputSource( new StringReader( xmlFile1 ) ); - val parsedxml11 = XML.load( isrc11 ); + val xmlFile1 = ""; + val isrc1 = new InputSource( new StringReader(xmlFile1) ); + val parsedxml1 = XML.load(isrc1); + val isrc11 = new InputSource( new StringReader( xmlFile1 ) ); + val parsedxml11 = XML.load(isrc11); val c = new Node { def label = "hello"; override def hashCode() = Utility.hashCode(prefix, label, attributes.hashCode(), scope.hashCode(), child); def child = Elem(null, "world", e, sc); - override def text = "" //def attributes = e; override def text = ""; }; @@ -29,8 +28,8 @@ object Test { assertSameElements( List( 3 ), List( 3 )); Console.println("equality"); - assertEquals( c, parsedxml11 ); - assertEquals( parsedxml1, parsedxml11 ); + assertEquals(c, parsedxml11); + assertEquals(parsedxml1, parsedxml11); assertSameElements( List(parsedxml1), List(parsedxml11)); assertSameElements( Iterator.fromArray(Predef.Array(parsedxml1)).toList, List(parsedxml11)); @@ -39,10 +38,10 @@ object Test { val i = new InputSource( new StringReader( x2 )); val x2p = XML.load( i ); - assertEquals(x2p, Elem(null,"book",e,sc, - 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")))); + assertEquals(x2p, Elem(null, "book" , e, sc, + 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 = "Peter BunemanDan SuciuData on ze webJohn MitchellFoundations of Programming Languages"; val isrc2 = new InputSource( new StringReader( xmlFile2 ) ); @@ -61,17 +60,17 @@ object Test { Console.println( (parsedxml2 \ "_" ).elements); for( val i <- (parsedxml2 \ "_" ).elements) { Console.println( i ); - }; + }; */ assertSameElements( parsedxml2 \ "_" , List( - Elem(null,"book", e,sc, - 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("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")))) @@ -83,12 +82,12 @@ object Test { List( Elem(null,"book",e,sc, - 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")), + 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,"author", e, sc, Text("John Mitchell")), + Elem(null,"title" , e, sc, Text("Foundations of Programming Languages"))) ) ); @@ -97,11 +96,11 @@ object Test { parsedxml2 \ "_" \ "_", List( - 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")) + 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")) ) ); @@ -110,9 +109,9 @@ object Test { parsedxml2 \ "_" \ "author", List( - Elem(null,"author",e,sc,Text("Peter Buneman")), - Elem(null,"author",e,sc,Text("Dan Suciu")), - Elem(null,"author",e,sc,Text("John Mitchell")) + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("John Mitchell")) ) ); @@ -126,9 +125,9 @@ object Test { parsedxml2 \\ "author", List( - Elem(null,"author",e,sc,Text("Peter Buneman")), - Elem(null,"author",e,sc,Text("Dan Suciu")), - Elem(null,"author",e,sc,Text("John Mitchell")) + Elem(null,"author", e, sc, Text("Peter Buneman")), + Elem(null,"author", e, sc, Text("Dan Suciu")), + Elem(null,"author", e, sc, Text("John Mitchell")) ) ); @@ -139,9 +138,9 @@ object Test { 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,"title",e,sc,Text("Data on ze web"))), + 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")))), @@ -171,8 +170,8 @@ object Test { parsedxml2 \\ "title", List( - Elem(null,"title",e,sc,Text("Data on ze web")), - Elem(null,"title",e,sc,Text("Foundations of Programming Languages"))) + Elem(null,"title", e, sc, Text("Data on ze web")), + Elem(null,"title", e, sc, Text("Foundations of Programming Languages"))) ); -- cgit v1.2.3