Search in sources :

Example 1 with CodeMachine

use of com.squarespace.template.CodeMachine in project template-compiler by Squarespace.

the class UnitsMetricPredicateTest method run.

private void run(CLDR.Locale locale, String template, String expected) throws CodeException {
    Context ctx = new Context(new TextNode(""));
    ctx.cldrLocale(locale);
    CodeMachine sink = machine();
    tokenizer(template, sink).consume();
    ctx.execute(sink.getCode());
    Assert.assertEquals(ctx.buffer().toString(), expected);
}
Also used : Context(com.squarespace.template.Context) CodeMachine(com.squarespace.template.CodeMachine) TextNode(com.fasterxml.jackson.databind.node.TextNode)

Aggregations

TextNode (com.fasterxml.jackson.databind.node.TextNode)1 CodeMachine (com.squarespace.template.CodeMachine)1 Context (com.squarespace.template.Context)1