From 4afa092314487c0095ff9fd5756d05340f6150b0 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 19 May 2011 20:06:19 +0000 Subject: Removes SUnit (long deprecated!) from the stand... Removes SUnit (long deprecated!) from the standard library. the relatively small number of partest tests in Scala's suite that were still using SUnit now either just use regular asserts, or they print stuff that partest checks with a .check file. Also fixed some bad indentation, removed ancient useless-looking commented-out code, etc. Contributed by Seth Tisue (way to go seth) no review. --- test/files/jvm/xml03syntax.scala | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'test/files/jvm/xml03syntax.scala') diff --git a/test/files/jvm/xml03syntax.scala b/test/files/jvm/xml03syntax.scala index 2fee0243a6..2c93f7c176 100644 --- a/test/files/jvm/xml03syntax.scala +++ b/test/files/jvm/xml03syntax.scala @@ -1,7 +1,6 @@ -import scala.testing.SUnit._ import scala.xml._ -object Test extends AnyRef with Assert { +object Test { private def handle[A](x: Node): A = { println(x) @@ -9,15 +8,15 @@ object Test extends AnyRef with Assert { } def main(args: Array[String]) { - test1 - test2 - test3 + test1() + test2() + test3() } - private def test1 { + private def test1() { val xNull = {null} // these used to be Atom(unit), changed to empty children - assertSameElements(xNull.child, Nil) + println(xNull.child sameElements Nil) val x0 = {} // these used to be Atom(unit), changed to empty children val x00 = { } // dto. @@ -25,29 +24,29 @@ object Test extends AnyRef with Assert { val xa = { "world" } - assertSameElements(x0.child, Nil) - assertSameElements(x00.child, Nil) - assertEquals(handle[String](xa), "world") + println(x0.child sameElements Nil) + println(x00.child sameElements Nil) + println(handle[String](xa) == "world") val xb = { 1.5 } - assertEquals(handle[Double](xb), 1.5) + println(handle[Double](xb) == 1.5) val xc = { 5 } - assertEquals(handle[Int](xc), 5) + println(handle[Int](xc) == 5) val xd = { true } - assertEquals(handle[Boolean](xd), true) + println(handle[Boolean](xd) == true) val xe = { 5:Short } - assertEquals(handle[Short](xe), 5:Short) + println(handle[Short](xe) == (5:Short)) val xf = { val x = 27; x } - assertEquals(handle[Int](xf), 27) + println(handle[Int](xf) == 27) val xg = { List(1,2,3,4) } @@ -68,7 +67,7 @@ object Test extends AnyRef with Assert { /** see SVN r13821 (emir): support for , * so that Options can be used for optional attributes. */ - private def test2 { + private def test2() { val x1: Option[Seq[Node]] = Some(hello) val n1 = ; println("node="+n1+", key="+n1.attribute("key")) @@ -78,7 +77,7 @@ object Test extends AnyRef with Assert { println("node="+n2+", key="+n2.attribute("key")) } - private def test3 { + private def test3() { // this demonstrates how to handle entities val s = io.Source.fromString(" ") object parser extends xml.parsing.ConstructingParser(s, false /*ignore ws*/) { -- cgit v1.2.3