示例#1
0
 public void TestSliceAtError()
 {
     TestParser.AssertTemplate("text(1,17) : error : Invalid number of arguments `0` passed to `string.slice1` while expecting `2` arguments", "{{ string.slice1 }}");
 }
示例#2
0
 public void TestMathRandomError()
 {
     TestParser.AssertTemplate("text(1,4) : error : minValue must be greater than maxValue", "{{ math.random 11 10 }}");
 }
示例#3
0
 public void TestLiquidWithAndArguments()
 {
     TestParser.AssertTemplate("tada : 1 + yoyo", "{% include 'with_arguments' with 'tada' var1: 1, var2: 'yoyo' %}", ScriptLang.Liquid);
 }
示例#4
0
 public void TestSortNoError()
 {
     TestParser.AssertTemplate("true", "{{ [1,2] || array.sort }}");
 }
示例#5
0
 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);
 }
示例#6
0
 public void TestLiquidArguments()
 {
     TestParser.AssertTemplate("1 + yoyo", "{% include 'arguments' var1: 1, var2: 'yoyo' %}", ScriptLang.Liquid);
 }
示例#7
0
 public void TestLiquidNull()
 {
     TestParser.AssertTemplate("", "{% include a %}", ScriptLang.Liquid);
 }
示例#8
0
 public void TestLiquidWith()
 {
     TestParser.AssertTemplate("with_product: Orange", "{% include 'with_product' with product %}", ScriptLang.Liquid);
 }
示例#9
0
 public void TestNested()
 {
     TestParser.AssertTemplate("This is a header body This is a body_detail This is a footer", "{{ include 'nested_templates' }}");
 }
示例#10
0
 public void TestRecursiveNested()
 {
     TestParser.AssertTemplate("56789", "{{ include 'recursive_nested_templates' 5 }}");
 }
示例#11
0
 public void TestProduct()
 {
     TestParser.AssertTemplate("product: Orange", "{{ include 'product' }}");
 }
示例#12
0
 public void TestArguments()
 {
     TestParser.AssertTemplate("1 + 2", "{{ include 'arguments' 1 2 }}");
 }
示例#13
0
 public void TestSimple()
 {
     TestParser.AssertTemplate("Test with a include yoyo", "Test with a include {{ include 'yoyo' }}");
 }
示例#14
0
 public void TestLiquidNull()
 {
     TestParser.AssertTemplate("", "{% include a %}", true);
 }
示例#15
0
 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 }}");
 }