diff options
author | Burak Emir <emir@epfl.ch> | 2008-02-16 18:38:12 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2008-02-16 18:38:12 +0000 |
commit | 9289284717673b7394a920daf8420d214afcff8f (patch) | |
tree | 36eb591b6bbb713c151189ed40fbce180cbe750d /test/files/jvm | |
parent | e086a4440b51a39f0f6d953b06f8efa1c063b571 (diff) | |
download | scala-9289284717673b7394a920daf8420d214afcff8f.tar.gz scala-9289284717673b7394a920daf8420d214afcff8f.tar.bz2 scala-9289284717673b7394a920daf8420d214afcff8f.zip |
made semantics of MetaData append safer, fixed ...
made semantics of MetaData append safer, fixed test
Diffstat (limited to 'test/files/jvm')
-rw-r--r-- | test/files/jvm/xmlattr.scala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/files/jvm/xmlattr.scala b/test/files/jvm/xmlattr.scala index 0e519f51df..a947adf231 100644 --- a/test/files/jvm/xmlattr.scala +++ b/test/files/jvm/xmlattr.scala @@ -2,7 +2,7 @@ import testing.SUnit.{Assert, TestCase, TestConsoleMain, TestSuite} import xml.{NodeSeq, Null, Text, UnprefixedAttribute} object Test extends TestConsoleMain { - def suite = new TestSuite() + def suite = new TestSuite(UnprefixedAttributeTest, AttributeWithOptionTest) object UnprefixedAttributeTest extends TestCase("UnprefixedAttribute") with Assert { override def runTest { @@ -19,6 +19,13 @@ object Test extends TestConsoleMain { val z = new UnprefixedAttribute("foo", null:NodeSeq, x) assertEquals(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) } } @@ -39,8 +46,8 @@ object Test extends TestConsoleMain { assertEquals(None, y.attributes.get("bar")) assertEquals(null, y.attributes("bar")) - val z = new UnprefixedAttribute("bar", None, x) - assertEquals(z.get("foo"), None) // None + val z = new UnprefixedAttribute("foo", None, x) + assertEquals(None, z.get("foo")) // None } } |