Skip to content

Commit

Permalink
ISSUR-280: example of delaying parsing and execution when you don't n…
Browse files Browse the repository at this point in the history
…eed it cached, though you could still cache it yourself.
  • Loading branch information
spullara committed Aug 28, 2023
1 parent 43fd04a commit 8c97ec4
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,23 @@ public void testRootCheck() throws MustacheException, IOException, ExecutionExce
}
}

public void testIssue280() throws IOException {
MustacheFactory c = createMustacheFactory();
StringWriter sw = new StringWriter();
Mustache m = c.compile(new StringReader("{{{template}}}"), "test");
Object o = new Object() {
String template() throws IOException {
MustacheFactory c = createMustacheFactory();
StringWriter sw = new StringWriter();
Mustache m = c.compile("template.html");
m.execute(sw, new Object()).flush();
return sw.toString();
}
};
m.execute(sw, o).flush();
assertTrue(sw.toString().startsWith("<html>"));
}

public void testSimpleFiltered() throws MustacheException, IOException, ExecutionException, InterruptedException {
MustacheFactory c = new DefaultMustacheFactory(root) {
@Override
Expand Down

0 comments on commit 8c97ec4

Please sign in to comment.