Search in sources :

Example 1 with EofInst

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

the class InstructionEqualityTest method testEofEquals.

@Test
public void testEofEquals() throws CodeSyntaxException {
    CodeMaker mk = maker();
    EofInst e1 = mk.eof();
    assertEquals(e1, mk.eof());
    assertNotEquals(e1, mk.space());
    assertNotEquals(e1, mk.end());
}
Also used : EofInst(com.squarespace.template.Instructions.EofInst) Test(org.testng.annotations.Test)

Example 2 with EofInst

use of com.squarespace.template.Instructions.EofInst 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

EofInst (com.squarespace.template.Instructions.EofInst)2 Test (org.testng.annotations.Test)2 VariableInst (com.squarespace.template.Instructions.VariableInst)1