Esempio n. 1
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.EQ))
       .matches("=")
       .matches("  =")
       .matches("=  ")
       .matches("   =    ");
 }
Esempio n. 2
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.CHAR_REF))
       .matches("�")
       .matches("{")
       .matches("")
       .notMatches("&#AB;");
 }
Esempio n. 3
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.PI))
       .matches("<?foo?>")
       .matches("<?foo bar?>")
       .matches("<?foo bar baz ?>")
       .notMatches("<??>")
       .notMatches("<?xml?>");
 }
Esempio n. 4
0
 @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)>");
 }
Esempio n. 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 ");
 }
Esempio n. 6
0
 // 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;)* >");
 }
Esempio n. 7
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.PUBLIC_ID)).matches("PUBLIC \"foo\"");
 }
Esempio n. 8
0
 @Test
 public void ok() {
   assertThat(g.rule(XmlGrammar.CD_START)).matches("<![CDATA[").notMatches("<![cdata[");
 }