diff options
author | buraq <buraq@epfl.ch> | 2005-06-18 15:58:57 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2005-06-18 15:58:57 +0000 |
commit | eee9ffbb4ae0fdc75885cd530d84b493ecd6325b (patch) | |
tree | 64369b53393d4a53cb9417bdf52e52ad92134332 /test/files/jvm | |
parent | dd9c59cc23aa4788996931654d4be465ae2649ce (diff) | |
download | scala-eee9ffbb4ae0fdc75885cd530d84b493ecd6325b.tar.gz scala-eee9ffbb4ae0fdc75885cd530d84b493ecd6325b.tar.bz2 scala-eee9ffbb4ae0fdc75885cd530d84b493ecd6325b.zip |
added test case for ElementValidator
Diffstat (limited to 'test/files/jvm')
-rw-r--r-- | test/files/jvm/xmlstuff.check | 2 | ||||
-rw-r--r-- | test/files/jvm/xmlstuff.scala | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/jvm/xmlstuff.check b/test/files/jvm/xmlstuff.check index 393a4813c8..9803618268 100644 --- a/test/files/jvm/xmlstuff.check +++ b/test/files/jvm/xmlstuff.check @@ -26,3 +26,5 @@ namespaces passed ok passed ok passed ok +validation +passed ok diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index 90ae82e18a..82d58a59a3 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -122,6 +122,7 @@ val addrBook = case _ => false; }, true); + /* namespaces */ // begin tmp Console.println("namespaces"); @@ -156,4 +157,16 @@ DEPRECATED, don't support namespaces in pattern match anymore case _ => false; }); // end tmp */ + Console.println("validation"); + val vtor = new scala.xml.dtd.ElementValidator(); + { + import scala.xml.dtd.ELEMENTS; + import scala.xml.dtd.ContentModel._; + vtor.setContentModel( + ELEMENTS( + Sequ( + Letter(ElemName("bar")), + Star(Letter(ElemName("baz"))) ))); + } + assertEquals( vtor( <foo><bar/><baz/><baz/></foo> ), true ); } |