summaryrefslogtreecommitdiff
path: root/test/files/jvm
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-02-27 09:55:23 +0000
committerBurak Emir <emir@epfl.ch>2007-02-27 09:55:23 +0000
commit8cd3a8fcd5bab2acf77f246519a9a71727710d7e (patch)
tree72fb78efe2e45d5cc3d270691997ee24ee9affd2 /test/files/jvm
parente30503f10056bdff6eb066122607c5e42e2cabb9 (diff)
downloadscala-8cd3a8fcd5bab2acf77f246519a9a71727710d7e.tar.gz
scala-8cd3a8fcd5bab2acf77f246519a9a71727710d7e.tar.bz2
scala-8cd3a8fcd5bab2acf77f246519a9a71727710d7e.zip
xml.Elem has now {apply,unapply} !
+ Utility.trim function to remove whitespace + tests
Diffstat (limited to 'test/files/jvm')
-rw-r--r--test/files/jvm/unittest_xml.scala27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/files/jvm/unittest_xml.scala b/test/files/jvm/unittest_xml.scala
index 99284f144e..a6032e257c 100644
--- a/test/files/jvm/unittest_xml.scala
+++ b/test/files/jvm/unittest_xml.scala
@@ -47,10 +47,35 @@ object Test {
}
}
+ class UtilityTest extends TestCase("scala.xml.Utility") with Assert {
+ val x = <foo>
+ <toomuchws/>
+ </foo>
+
+ val y = xml.Utility.trim(x)
+
+ assertEquals("trim 1 ", 1, y match { case <foo><toomuchws/></foo> => 1 })
+
+ val x2 = <foo>
+ <toomuchws> a b b a </toomuchws>
+ </foo>
+
+ val y2 = xml.Utility.trim(x2)
+
+ assertEquals("trim 2 ", 2, y2 match { case <foo><toomuchws>a b b a</toomuchws></foo> => 2 })
+
+
+ val z = <bar>''</bar>
+ val z1 = z.toString
+
+ assertEquals("apos unescaped", "<bar>''</bar>", z1)
+ }
+
def main(args:Array[String]) = {
val ts = new TestSuite(
new ParsingTest,
- new MetaDataTest //,
+ new MetaDataTest,
+ new UtilityTest
)
val tr = new TestResult()
ts.run(tr)