Skip to content

Commit

Permalink
Duplicate tests for insert & replace processors, #178
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Mar 25, 2019
1 parent a918b79 commit 380cb9b
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Test for an infinite loop when nesting fragments, based off
# /~https://github.com/ultraq/thymeleaf-layout-dialect/issues/178

%TEMPLATE_MODE HTML


%INPUT
<html>
<body>
<div layout:fragment="comment">
Comment structure
<div layout:fragment="comment-details">Default comment details</div>
</div>

<div layout:insert="~{::comment}">
<div layout:fragment="comment-details">
Top level comment
<div layout:insert="~{::comment}">
<div layout:fragment="comment-details">Nested comment</div>
</div>
</div>
</div>
</body>
</html>

%OUTPUT
<html>
<body>
<div>
Comment structure
<div>Default comment details</div>
</div>
<div>
<div>
Comment structure
<div>
Top level comment
<div>
<div>
Comment structure
<div>Nested comment</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# Test for an infinite loop when nesting fragments, based off
# /~https://github.com/ultraq/thymeleaf-layout-dialect/issues/178

%TEMPLATE_MODE HTML


%INPUT
<html>
<body>
<div layout:fragment="comment">
Comment structure
<div layout:fragment="comment-details">Default comment details</div>
</div>

<div layout:replace="~{::comment}">
<div layout:fragment="comment-details">
Top level comment
<div layout:replace="~{::comment}">
<div layout:fragment="comment-details">Nested comment</div>
</div>
</div>
</div>
</body>
</html>

%OUTPUT
<html>
<body>
<div>
Comment structure
<div>Default comment details</div>
</div>
<div>
Comment structure
<div>
Top level comment
<div>
Comment structure
<div>Nested comment</div>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 380cb9b

Please sign in to comment.