public void TestSliceAtError() { TestParser.AssertTemplate("text(1,17) : error : Invalid number of arguments `0` passed to `string.slice1` while expecting `2` arguments", "{{ string.slice1 }}"); }
public void TestMathRandomError() { TestParser.AssertTemplate("text(1,4) : error : minValue must be greater than maxValue", "{{ math.random 11 10 }}"); }
public void TestLiquidWithAndArguments() { TestParser.AssertTemplate("tada : 1 + yoyo", "{% include 'with_arguments' with 'tada' var1: 1, var2: 'yoyo' %}", ScriptLang.Liquid); }
public void TestSortNoError() { TestParser.AssertTemplate("true", "{{ [1,2] || array.sort }}"); }
public void TestLiquidFor() { TestParser.AssertTemplate("for_product: Orange for_product: Banana for_product: Apple for_product: Computer for_product: Mobile Phone for_product: Table for_product: Sofa ", "{% include 'for_product' for products %}", ScriptLang.Liquid); }
public void TestLiquidArguments() { TestParser.AssertTemplate("1 + yoyo", "{% include 'arguments' var1: 1, var2: 'yoyo' %}", ScriptLang.Liquid); }
public void TestLiquidNull() { TestParser.AssertTemplate("", "{% include a %}", ScriptLang.Liquid); }
public void TestLiquidWith() { TestParser.AssertTemplate("with_product: Orange", "{% include 'with_product' with product %}", ScriptLang.Liquid); }
public void TestNested() { TestParser.AssertTemplate("This is a header body This is a body_detail This is a footer", "{{ include 'nested_templates' }}"); }
public void TestRecursiveNested() { TestParser.AssertTemplate("56789", "{{ include 'recursive_nested_templates' 5 }}"); }
public void TestProduct() { TestParser.AssertTemplate("product: Orange", "{{ include 'product' }}"); }
public void TestArguments() { TestParser.AssertTemplate("1 + 2", "{{ include 'arguments' 1 2 }}"); }
public void TestSimple() { TestParser.AssertTemplate("Test with a include yoyo", "Test with a include {{ include 'yoyo' }}"); }
public void TestLiquidNull() { TestParser.AssertTemplate("", "{% include a %}", true); }
public void TestSortError() { TestParser.AssertTemplate("text(1,19) : error : Invalid number of arguments `0` passed to `array.sort` while expecting at least `1` arguments", "{{ [1,2] || array.sort }}"); }