Example #1
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.EQ))
       .matches("=")
       .matches("  =")
       .matches("=  ")
       .matches("   =    ");
 }
Example #2
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.CHAR_REF))
       .matches("�")
       .matches("{")
       .matches("")
       .notMatches("&#AB;");
 }
Example #3
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.PI))
       .matches("<?foo?>")
       .matches("<?foo bar?>")
       .matches("<?foo bar baz ?>")
       .notMatches("<??>")
       .notMatches("<?xml?>");
 }
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.ELEMENT_DECL))
       .matches("<!ELEMENT br EMPTY>")
       .matches("<!ELEMENT p (#PCDATA|emph)* >")
       .matches("<!ELEMENT container ANY>")
       .matches("<!ELEMENT spec (front, body, back?)>")
       .matches("<!ELEMENT div1 (head, (p | list | note)*, div2*)>")
       .matches("<!ELEMENT p (#PCDATA|a|ul|b|i|em)*>")
       .matches("<!ELEMENT b (#PCDATA)>");
 }
Example #5
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.NAME))
       .matches("foo")
       .matches("foo42")
       .matches(":")
       .matches("F")
       .matches("_")
       .matches("h")
       .matches("\u00D0")
       .matches("\u00D9")
       .notMatches("\u00D7")
       .notMatches("-")
       .notMatches("\u200E")
       .notMatches("foo?")
       .notMatches("foo ");
 }
 // TEST - FIXME: "Name does not match %, looks like a PEReference, email sent to xml-editors"
 public void w3() {
   assertThat(g.rule(XmlGrammar.ELEMENT_DECL))
       .matches("<!ELEMENT %name.para; %content.para; >")
       .matches("<!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*>")
       .matches("<!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >");
 }
Example #7
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.PUBLIC_ID)).matches("PUBLIC \"foo\"");
 }
Example #8
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.CD_START)).matches("<![CDATA[").notMatches("<![cdata[");
 }