Skip to content

Commit

Permalink
Issue checkstyle#4381: Added new UTs for javadoc grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
voidfist committed Jun 24, 2017
1 parent b4c6108 commit a4c1737
Show file tree
Hide file tree
Showing 9 changed files with 825 additions and 0 deletions.
Expand Up @@ -196,4 +196,52 @@ public void testInlineCustomJavadocTag() throws Exception {
verifyJavadocTree(getDocPath("expectedInlineCustomJavadocTagAst.txt"),
getDocPath("InputInlineCustomJavadocTag.txt"));
}

@Test
public void testAttributeValueWithoutQuotes() throws Exception {
verifyJavadocTree(getHtmlPath("expectedAttributeValueWithoutQuotesAst.txt"),
getHtmlPath("InputAttributeValueWithoutQuotes.txt"));
}

@Test
public void testClosedOtherTag() throws Exception {
verifyJavadocTree(getHtmlPath("expectedClosedOtherTagAst.txt"),
getHtmlPath("InputClosedOtherTag.txt"));
}

@Test
public void testAllStandardJavadocTags() throws Exception {
verifyJavadocTree(getDocPath("expectedAllStandardJavadocTagsAst.txt"),
getDocPath("InputAllStandardJavadocTags.txt"));
}

@Test
public void testAsteriskInJavadocInlineTag() throws Exception {
verifyJavadocTree(getDocPath("expectedAsteriskInJavadocInlineTagAst.txt"),
getDocPath("InputAsteriskInJavadocInlineTag.txt"));
}

@Test
public void testAsteriskInLiteral() throws Exception {
verifyJavadocTree(getDocPath("expectedAsteriskInLiteralAst.txt"),
getDocPath("InputAsteriskInLiteral.txt"));
}

@Test
public void testInnerBracesInCodeTag() throws Exception {
verifyJavadocTree(getDocPath("expectedInnerBracesInCodeTagAst.txt"),
getDocPath("InputInnerBracesInCodeTag.txt"));
}

@Test
public void testNewlineAndAsteriskInParameters() throws Exception {
verifyJavadocTree(getDocPath("expectedNewlineAndAsteriskInParametersAst.txt"),
getDocPath("InputNewlineAndAsteriskInParameters.txt"));
}

@Test
public void testTwoLinkTagsInRow() throws Exception {
verifyJavadocTree(getDocPath("expectedTwoLinkTagsInRowAst.txt"),
getDocPath("InputTwoLinkTagsInRow.txt"));
}
}
@@ -0,0 +1,21 @@
JAVADOC -> JAVADOC [0:0]
|--HTML_ELEMENT -> HTML_ELEMENT [0:0]
| `--HTML_TAG -> HTML_TAG [0:0]
| |--HTML_ELEMENT_OPEN -> HTML_ELEMENT_OPEN [0:0]
| | |--OPEN -> < [0:0]
| | |--HTML_TAG_NAME -> a [0:1]
| | |--WS -> [0:2]
| | |--ATTRIBUTE -> ATTRIBUTE [0:3]
| | | |--HTML_TAG_NAME -> href [0:3]
| | | |--EQUALS -> = [0:7]
| | | `--ATTR_VALUE -> http://www.ietf.org/rfc/rfc3758.txt [0:8]
| | `--CLOSE -> > [0:44]
| |--TEXT -> RFC 3758 [0:45]
| `--HTML_ELEMENT_CLOSE -> HTML_ELEMENT_CLOSE [0:53]
| |--OPEN -> < [0:53]
| |--SLASH -> / [0:54]
| |--HTML_TAG_NAME -> a [0:55]
| `--CLOSE -> > [0:56]
|--TEXT -> . [0:57]
|--NEWLINE -> \r\n [0:58]
`--EOF -> <EOF> [1:0]
@@ -0,0 +1,15 @@
JAVADOC -> JAVADOC [0:0]
|--TEXT -> [0:0]
|--HTML_ELEMENT -> HTML_ELEMENT [0:1]
| `--DD_TAG_OPEN -> DD_TAG_OPEN [0:1]
| |--OPEN -> < [0:1]
| |--DD_HTML_TAG_NAME -> dd [0:2]
| `--CLOSE -> > [0:4]
|--HTML_ELEMENT -> HTML_ELEMENT [0:5]
| `--DT_TAG_CLOSE -> DT_TAG_CLOSE [0:5]
| |--OPEN -> < [0:5]
| |--SLASH -> / [0:6]
| |--DT_HTML_TAG_NAME -> dt [0:7]
| `--CLOSE -> > [0:9]
|--NEWLINE -> \r\n [0:10]
`--EOF -> <EOF> [1:0]

0 comments on commit a4c1737

Please sign in to comment.