summaryrefslogtreecommitdiff
path: root/test/files/jvm/xmlattr.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-19 20:06:19 +0000
committerPaul Phillips <paulp@improving.org>2011-05-19 20:06:19 +0000
commit4afa092314487c0095ff9fd5756d05340f6150b0 (patch)
treed3cf421e67192041f78858fe10735505f4891b3c /test/files/jvm/xmlattr.scala
parent7595671ec3929aa4ac978826521300a900250214 (diff)
downloadscala-4afa092314487c0095ff9fd5756d05340f6150b0.tar.gz
scala-4afa092314487c0095ff9fd5756d05340f6150b0.tar.bz2
scala-4afa092314487c0095ff9fd5756d05340f6150b0.zip
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.
Diffstat (limited to 'test/files/jvm/xmlattr.scala')
-rw-r--r--test/files/jvm/xmlattr.scala65
1 files changed, 34 insertions, 31 deletions
diff --git a/test/files/jvm/xmlattr.scala b/test/files/jvm/xmlattr.scala
index a947adf231..2668819c9d 100644
--- a/test/files/jvm/xmlattr.scala
+++ b/test/files/jvm/xmlattr.scala
@@ -1,60 +1,63 @@
-import testing.SUnit.{Assert, TestCase, TestConsoleMain, TestSuite}
-import xml.{NodeSeq, Null, Text, UnprefixedAttribute}
+import xml.{ NodeSeq, Null, Text, UnprefixedAttribute }
-object Test extends TestConsoleMain {
- def suite = new TestSuite(UnprefixedAttributeTest, AttributeWithOptionTest)
+object Test {
- object UnprefixedAttributeTest extends TestCase("UnprefixedAttribute") with Assert {
- override def runTest {
- var x = new UnprefixedAttribute("foo","bar", Null)
+ def main(args: Array[String]) {
+ UnprefixedAttributeTest()
+ AttributeWithOptionTest()
+ AttributeOutputTest()
+ }
- // always assertX(expected, actual)
- assertEquals(Some(Text("bar")), x.get("foo"));
- assertEquals(Text("bar"), x("foo"))
- assertEquals(None, x.get("no_foo"))
- assertEquals(null, x("no_foo"))
+ object UnprefixedAttributeTest {
+ def apply() {
+ val x = new UnprefixedAttribute("foo","bar", Null)
+ println(Some(Text("bar")) == x.get("foo"))
+ println(Text("bar") == x("foo"))
+ println(None == x.get("no_foo"))
+ println(null == x("no_foo"))
val y = x.remove("foo")
- assertEquals(Null, y)
+ println(Null == y)
val z = new UnprefixedAttribute("foo", null:NodeSeq, x)
- assertEquals(None, z.get("foo"))
+ println(None == z.get("foo"))
var appended = x append x append x append x
var len = 0; while (appended ne Null) {
appended = appended.next
len = len + 1
}
- assertEquals("removal of duplicates for unprefixed attributes in append", 1, len)
+ println("removal of duplicates for unprefixed attributes in append = " + len)
}
}
- object AttributeWithOptionTest extends TestCase("AttributeWithOption") with Assert {
- override def runTest {
- var x = new UnprefixedAttribute("foo", Some(Text("bar")), Null)
+ object AttributeWithOptionTest {
+ def apply() {
+ val x = new UnprefixedAttribute("foo", Some(Text("bar")), Null)
- assertEquals(Some(Text("bar")), x.get("foo"));
- assertEquals(Text("bar"), x("foo"))
- assertEquals(None, x.get("no_foo"))
- assertEquals(null, x("no_foo"))
+ println(Some(Text("bar")) == x.get("foo"))
+ println(Text("bar") == x("foo"))
+ println(None == x.get("no_foo"))
+ println(null == x("no_foo"))
val attr1 = Some(Text("foo value"))
val attr2 = None
val y = <b foo={attr1} bar={attr2} />
- assertEquals(Some(Text("foo value")), y.attributes.get("foo"));
- assertEquals(Text("foo value"), y.attributes("foo"))
- assertEquals(None, y.attributes.get("bar"))
- assertEquals(null, y.attributes("bar"))
+ println(Some(Text("foo value")) == y.attributes.get("foo"));
+ println(Text("foo value") == y.attributes("foo"))
+ println(None == y.attributes.get("bar"))
+ println(null == y.attributes("bar"))
val z = new UnprefixedAttribute("foo", None, x)
- assertEquals(None, z.get("foo")) // None
+ println(None == z.get("foo"))
}
}
- object AttributeOutputTest extends TestCase("AttributeOutput") with Assert {
- override def runTest {
- assertEquals(<b x="&amp;"/>.toString, "<b x=\"&amp;\"></b>")
- assertEquals( <b x={"&"}/>.toString, "<b x=\"&amp;\"></b>")
+ object AttributeOutputTest {
+ def apply() {
+ println(<b x="&amp;"/>)
+ println(<b x={"&"}/>)
}
}
+
}