Skip to content

Commit

Permalink
Adjust error DTD range for MSG_CONTENT_INCOMPLETE (see #107)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Nov 14, 2018
1 parent 9b07e07 commit 0cc291a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ public void MSG_ATTRIBUTE_VALUE_NOT_IN_LIST() throws Exception {
"</foo>";
XMLAssert.testDiagnosticsFor(xml, d(7, 15, 21, DTDErrorCode.MSG_ATTRIBUTE_VALUE_NOT_IN_LIST));
}

@Test
public void MSG_CONTENT_INCOMPLETE() throws Exception {
String xml = "<?xml version = \"1.0\"?>\r\n" + //
"<!DOCTYPE foo [\r\n" + //
" <!ELEMENT foo (bar)>\r\n" + //
" <!ELEMENT bar (#PCDATA)>\r\n" + //
" <!ATTLIST bar fruit (one | two | three) #REQUIRED>\r\n" + //
"]>\r\n" + //
"<foo>\r\n" + //
" \r\n" + // <- error
"</foo>";
XMLAssert.testDiagnosticsFor(xml, d(6, 1, 4, DTDErrorCode.MSG_CONTENT_INCOMPLETE));
}

@Test
public void testDoctypeDiagnosticsRefresh() throws Exception {
//@formatter:off
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version = "1.0"?>
<!DOCTYPE foo [
<!ELEMENT foo (bar)>
<!ELEMENT bar (#PCDATA)>
<!ATTLIST bar fruit (one | two | three) #REQUIRED>
]>
<foo>

</foo>

0 comments on commit 0cc291a

Please sign in to comment.