Search in sources :

Example 6 with VariableInst

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

the class CompilerTest method testValidate.

@Test
public void testValidate() throws CodeException {
    CodeList code = new CodeList();
    code.accept(new VariableInst("@"));
    code.accept(new EofInst());
    ValidatedTemplate validated = COMPILER.validate("{@}");
    assertEquals(validated.code().getInstructions(), code.getInstructions());
}
Also used : EofInst(com.squarespace.template.Instructions.EofInst) VariableInst(com.squarespace.template.Instructions.VariableInst) Test(org.testng.annotations.Test)

Aggregations

VariableInst (com.squarespace.template.Instructions.VariableInst)6 Test (org.testng.annotations.Test)3 IfInst (com.squarespace.template.Instructions.IfInst)2 IfPredicateInst (com.squarespace.template.Instructions.IfPredicateInst)2 PredicateInst (com.squarespace.template.Instructions.PredicateInst)2 RepeatedInst (com.squarespace.template.Instructions.RepeatedInst)2 SectionInst (com.squarespace.template.Instructions.SectionInst)2 TextInst (com.squarespace.template.Instructions.TextInst)2 AlternatesWithInst (com.squarespace.template.Instructions.AlternatesWithInst)1 BindVarInst (com.squarespace.template.Instructions.BindVarInst)1 CommentInst (com.squarespace.template.Instructions.CommentInst)1 EofInst (com.squarespace.template.Instructions.EofInst)1 EvalInst (com.squarespace.template.Instructions.EvalInst)1 IncludeInst (com.squarespace.template.Instructions.IncludeInst)1 InjectInst (com.squarespace.template.Instructions.InjectInst)1 RootInst (com.squarespace.template.Instructions.RootInst)1 ReprEmitter.emitVariables (com.squarespace.template.ReprEmitter.emitVariables)1