summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-03-23 15:34:34 +0000
committerburaq <buraq@epfl.ch>2004-03-23 15:34:34 +0000
commit0ee73f9bb54fde7d9a6a12e2944590ab2d7de8fd (patch)
treeae7a6e3418dc47e8e38a89ff2fd740017463bd1c /test/files/run
parentd188fb525f72009251c2e98335d9d8eac0a7649c (diff)
downloadscala-0ee73f9bb54fde7d9a6a12e2944590ab2d7de8fd.tar.gz
scala-0ee73f9bb54fde7d9a6a12e2944590ab2d7de8fd.tar.bz2
scala-0ee73f9bb54fde7d9a6a12e2944590ab2d7de8fd.zip
more test cases
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/xmlLiterals.check3
-rw-r--r--test/files/run/xmlLiterals.scala19
2 files changed, 14 insertions, 8 deletions
diff --git a/test/files/run/xmlLiterals.check b/test/files/run/xmlLiterals.check
index a8e2049ae1..188d430d70 100644
--- a/test/files/run/xmlLiterals.check
+++ b/test/files/run/xmlLiterals.check
@@ -11,3 +11,6 @@ passed ok
passed ok
Seq(<foo></foo>, <bar>Text</bar>, <foo></foo>)
<foo></foo>
+passed ok
+passed ok
+passed ok
diff --git a/test/files/run/xmlLiterals.scala b/test/files/run/xmlLiterals.scala
index a2b5998fe5..f1483ffea7 100644
--- a/test/files/run/xmlLiterals.scala
+++ b/test/files/run/xmlLiterals.scala
@@ -41,7 +41,6 @@ object Test with Application {
<test/>
<mars></mars></hello>.toString(); /* ws in element content */
- /* Scala comments are not allowed in XML literals. see neg(2) */
assertEquals( noWS( x3 ),
Elem("hello",
@@ -49,12 +48,6 @@ object Test with Application {
Elem("test"),
Elem("mars")).toString() );
- /* examples that MUST fail
-
- val zzz = <hello>/* no comment */</hello>
- assertEquals( zzz, Elem("hello", Text("/* no comment */");
-
- */
/* */
/* === attributes === */
@@ -147,7 +140,17 @@ object Test with Application {
Console.println( onlyOne );
- val tryBrace = <try>Now we try escaped {{ braces }} </try>
+ val tryBrace = <try>Now we try escaped {{ braces } </try>;
+
+ assertEquals( tryBrace, Elem("try",Text("Now we try escaped { braces }")));
+
+ val tryBrace2 = <try myAttrib={ (3+4).toString() }> cool ?</try>;
+
+ assertEquals( tryBrace2("myAttrib").get, "7" );
+
+ /* Scala comments are not allowed in XML literals. see neg(2) */
+ val zzz = <hello>/* no comment */</hello>;
+ assertEquals( zzz, Elem("hello", Text("/* no comment */")));
}