From 53baf539c136ddd4baa55abcedd7bdaeba236ece Mon Sep 17 00:00:00 2001 From: Matt Coley Date: Wed, 29 Sep 2021 17:18:53 -0400 Subject: [PATCH] Unit test for escaped characters --- src/test/java/com/hubspot/jinjava/tree/TreeParserTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/com/hubspot/jinjava/tree/TreeParserTest.java b/src/test/java/com/hubspot/jinjava/tree/TreeParserTest.java index 2bf2d025a..dd4bd50ab 100644 --- a/src/test/java/com/hubspot/jinjava/tree/TreeParserTest.java +++ b/src/test/java/com/hubspot/jinjava/tree/TreeParserTest.java @@ -194,6 +194,13 @@ public void itWarnsTwiceAgainstUnclosedBlockTag() { assertThat(interpreter.getErrors().get(1).getLineno()).isEqualTo(1); } + @Test + public void itHandlesEscapedCharacters() throws Exception { + String expression = "{{'h\\u0003'}}"; + Node tree = new TreeParser(interpreter, expression).buildTree(); + assertThat(interpreter.render(tree)).isEqualTo("h\\u0003"); + } + Node parse(String fixture) { try { return new TreeParser(