Correct number of braces for error message
This commit is contained in:
@@ -457,7 +457,7 @@ public class Mustache
|
|||||||
int end3 = (char)source.read();
|
int end3 = (char)source.read();
|
||||||
if (end3 != '}') {
|
if (end3 != '}') {
|
||||||
throw new MustacheParseException(
|
throw new MustacheParseException(
|
||||||
"Invalid triple-mustache tag: {{{" + text + "}}", line);
|
"Invalid triple-mustache tag: {{{" + text.substring(1) + "}}", line);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new MustacheException(e);
|
throw new MustacheException(e);
|
||||||
|
|||||||
@@ -583,6 +583,15 @@ public class MustacheTest
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test public void testInvalidTripleMustache () {
|
||||||
|
try {
|
||||||
|
Mustache.compiler().compile("{{{foo}}");
|
||||||
|
fail("Expected MustacheParseException");
|
||||||
|
} catch (MustacheParseException e) {
|
||||||
|
assertEquals("Invalid triple-mustache tag: {{{foo}} @ line 1", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test public void testNullValueGetsNullDefault () {
|
@Test public void testNullValueGetsNullDefault () {
|
||||||
test(Mustache.compiler().nullValue("foo"),
|
test(Mustache.compiler().nullValue("foo"),
|
||||||
"foobar", "{{nullvar}}{{nonnullvar}}", new Object() {
|
"foobar", "{{nullvar}}{{nonnullvar}}", new Object() {
|
||||||
|
|||||||
Reference in New Issue
Block a user