use of com.google.template.soy.data.LoggingAdvisingAppendable.BufferingAppendable in project closure-templates by google.
the class AbstractLoggingAdvisingAppendableTest method testAppliesEscapersToPlaceholder.
@Test
public void testAppliesEscapersToPlaceholder() throws IOException {
BufferingAppendable buffering = LoggingAdvisingAppendable.buffering();
buffering.appendLoggingFunctionInvocation(LoggingFunctionInvocation.create("foo", "placeholder", ImmutableList.of()), ImmutableList.of(Functions.forMap(ImmutableMap.of("placeholder", "replacement"))));
assertThat(buffering.toString()).isEqualTo("replacement");
}
use of com.google.template.soy.data.LoggingAdvisingAppendable.BufferingAppendable in project closure-templates by google.
the class AbstractLoggingAdvisingAppendableTest method testLogonly_logonly_before_regular.
@Test
public void testLogonly_logonly_before_regular() throws IOException {
BufferingAppendable buffering = LoggingAdvisingAppendable.buffering();
buffering.enterLoggableElement(LOGONLY);
buffering.append("logonly");
buffering.exitLoggableElement();
buffering.enterLoggableElement(NOT_LOGONLY);
buffering.append("hello");
buffering.exitLoggableElement();
assertThat(buffering.toString()).isEqualTo("hello");
}
Aggregations