diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/unittest_xml.scala | 6 | ||||
-rw-r--r-- | test/files/neg/xmlcorner.scala | 16 | ||||
-rw-r--r-- | test/pending/jvm/backendBugUnapply.scala | 9 |
3 files changed, 29 insertions, 2 deletions
diff --git a/test/files/jvm/unittest_xml.scala b/test/files/jvm/unittest_xml.scala index b6d3da00f5..312b69d529 100644 --- a/test/files/jvm/unittest_xml.scala +++ b/test/files/jvm/unittest_xml.scala @@ -7,7 +7,7 @@ object Test { class ParsingTest extends TestCase("scala.xml.Parsing") with Assert { override def runTest = { assertTrue(Parsing.isNameStart('b')) - assertTrue(Parsing.isNameStart(':')) + assertFalse(Parsing.isNameStart(':')) } } class MetaDataTest extends TestCase("scala.xml.MetaData") with Assert { @@ -17,7 +17,9 @@ object Test { def domatch(x:Node): Node = { val hasBar = new HasKeyValue("bar") x match { - case Node("foo", hasBar(z), _*) => z + //case Node("foo", hasBar(z), _*) => z + case Node("foo", md, _*) if !hasBar.unapplySeq(md).isEmpty => + md("bar")(0) case _ => new Atom(3) } } diff --git a/test/files/neg/xmlcorner.scala b/test/files/neg/xmlcorner.scala index 9f1c55bce4..042ec05e68 100644 --- a/test/files/neg/xmlcorner.scala +++ b/test/files/neg/xmlcorner.scala @@ -4,3 +4,19 @@ class foo { class bar { val wrong = <bla: /> } + +// this "pos" test is only included as a parser test +object pos +{ + def wrap(f : Int => Unit) = f(5) + + wrap({ v => + if(v == 5) { + val n = { + val m = (<a>{}</a>) + <div>{ v }</div> + } + () + } + }) +} diff --git a/test/pending/jvm/backendBugUnapply.scala b/test/pending/jvm/backendBugUnapply.scala new file mode 100644 index 0000000000..f8abfeb713 --- /dev/null +++ b/test/pending/jvm/backendBugUnapply.scala @@ -0,0 +1,9 @@ +object Test { import scala.xml.{Node,HasKeyValue} + def domatch(x:Node): Node = { + val hasBar = new HasKeyValue("bar") + x match { + case Node("foo", hasBar(z), _*) => z + case _ => null + } + } +} |