Skip to content

Commit

Permalink
fix(jelly): Fix DocumentExample content to match the test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gounthar committed Oct 29, 2024
1 parent 1880383 commit 74af2bb
Showing 1 changed file with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,33 @@ public void defaults(RecipeSpec spec) {
/**
* Test to verify that the XML declaration is added to a simple Jelly file.
*/
@DocumentExample("<!-- Add an XML declaration to a simple Jelly file -->\n<root></root>\n<?jelly escape-by-default='true'?>\n<root></root>")
@DocumentExample(
"Input:\n" +
"<j:jelly xmlns:j=\"jelly:core\">\n" +
" <h1>Simple Example</h1>\n" +
"</j:jelly>\n\n" +
"Output:\n" +
"<?jelly escape-by-default='true'?>\n" +
"<j:jelly xmlns:j=\"jelly:core\">\n" +
" <h1>Simple Example</h1>\n" +
"</j:jelly>"
)
@Test
void addJellyXmlDeclaration() {
rewriteRun(
spec -> spec.expectedCyclesThatMakeChanges(1),
text(
"<j:jelly xmlns:j=\\\"jelly:core\\\">\n <h1>Simple Example</h1>\n</j:jelly>",
"<?jelly escape-by-default='true'?>\n<j:jelly xmlns:j=\\\"jelly:core\\\">\n <h1>Simple Example</h1>\n</j:jelly>",
"""
<j:jelly xmlns:j="jelly:core">
<h1>Simple Example</h1>
</j:jelly>
""",
"""
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
<h1>Simple Example</h1>
</j:jelly>
""",
spec -> spec.path("example.jelly")
)
);
Expand Down

0 comments on commit 74af2bb

Please sign in to comment.