@@ -633,7 +633,7 @@ class XMLTestJVM {
633633 import scala .xml .parsing ._
634634 @ UnitTest
635635 def dontLoop : Unit = {
636- val xml = " <!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "
636+ val xml = " <!DOCTYPE xmeml SYSTEM 'uri' > <xmeml> <sequence> </sequence> </xmeml> "
637637 val sink = new PrintStream (new ByteArrayOutputStream ())
638638 (Console withOut sink) {
639639 (Console withErr sink) {
@@ -765,4 +765,65 @@ class XMLTestJVM {
765765 val formatted = pp.format(x)
766766 assertEquals(x, XML .loadString(formatted))
767767 }
768+
769+ def toSource (s : String ) = new scala.io.Source {
770+ val iter = s.iterator
771+ override def reportError (pos : Int , msg : String , out : java.io.PrintStream = Console .err): Unit = {}
772+ }
773+
774+ @ UnitTest
775+ def xTokenTest {
776+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" a" ), false )
777+ assertEquals((): Unit , x.xToken('b' ))
778+ }
779+
780+ @ UnitTest (expected = classOf [FatalError ])
781+ def xCharDataFailure {
782+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" " ), false )
783+
784+ x.xCharData
785+ }
786+
787+ @ UnitTest (expected = classOf [FatalError ])
788+ def xCommentFailure {
789+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" " ), false )
790+
791+ x.xComment
792+ }
793+
794+ @ UnitTest
795+ def xmlProcInstrTest {
796+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" aa" ), false )
797+
798+ assertEquals(new UnprefixedAttribute (" aa" , Text (" " ), Null ), x.xmlProcInstr)
799+ }
800+
801+ @ UnitTest (expected = classOf [FatalError ])
802+ def notationDeclFailure {
803+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" " ), false )
804+
805+ x.notationDecl
806+ }
807+
808+ @ UnitTest
809+ def pubidLiteralTest {
810+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" " ), false )
811+
812+ assertEquals(" " , x.pubidLiteral)
813+ }
814+
815+ @ UnitTest
816+ def xAttributeValueTest {
817+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" '" ), false )
818+
819+ assertEquals(" " , x.xAttributeValue)
820+ }
821+
822+ @ UnitTest
823+ def xEntityValueTest {
824+ val x = xml.parsing.ConstructingParser .fromSource(toSource(" " ), false )
825+
826+ assertEquals(" " , x.xEntityValue)
827+ }
828+
768829}
0 commit comments