summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-11-09 10:00:35 +0000
committermichelou <michelou@epfl.ch>2005-11-09 10:00:35 +0000
commit90b93c790c6687ae34d3519f4b1fb6dd91007e9f (patch)
treedac5205efc10989a46828d813153fc9332e13a85 /test
parent977cbd4ef5b5ad120d326ab6f7748b959dc50351 (diff)
downloadscala-90b93c790c6687ae34d3519f4b1fb6dd91007e9f.tar.gz
scala-90b93c790c6687ae34d3519f4b1fb6dd91007e9f.tar.bz2
scala-90b93c790c6687ae34d3519f4b1fb6dd91007e9f.zip
- removed illegal code.
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/xml01.scala75
1 files changed, 37 insertions, 38 deletions
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 = "<hello><world/></hello>";
- 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 = "<hello><world/></hello>";
+ 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 = "<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>";
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")))
);