Browse Source

Copy test files (#134)

Andreas Stenius 11 years ago
parent
commit
d61650cbc8
81 changed files with 941 additions and 0 deletions
  1. 15 0
      test/erlydtl_custom_tags.erl
  2. 8 0
      test/files/expect/autoescape
  3. 11 0
      test/files/expect/block_super
  4. 15 0
      test/files/expect/comment
  5. 23 0
      test/files/expect/custom_call
  6. 33 0
      test/files/expect/custom_tag
  7. 47 0
      test/files/expect/cycle
  8. 3 0
      test/files/expect/extend_recursive_block
  9. 11 0
      test/files/expect/extends
  10. 14 0
      test/files/expect/extends_path
  11. 10 0
      test/files/expect/extends_path2
  12. 47 0
      test/files/expect/filters
  13. 13 0
      test/files/expect/for
  14. 7 0
      test/files/expect/for_list
  15. 7 0
      test/files/expect/for_list_preset
  16. 13 0
      test/files/expect/for_preset
  17. 13 0
      test/files/expect/for_records
  18. 23 0
      test/files/expect/for_records_preset
  19. 7 0
      test/files/expect/for_tuple
  20. 4 0
      test/files/expect/if
  21. 4 0
      test/files/expect/if_preset
  22. 28 0
      test/files/expect/ifequal
  23. 28 0
      test/files/expect/ifequal_preset
  24. 28 0
      test/files/expect/ifnotequal
  25. 28 0
      test/files/expect/ifnotequal_preset
  26. 2 0
      test/files/expect/include
  27. 12 0
      test/files/expect/include_path
  28. 14 0
      test/files/expect/include_template
  29. 6 0
      test/files/expect/recursive_block
  30. 2 0
      test/files/expect/ssi
  31. 1 0
      test/files/expect/trans
  32. 5 0
      test/files/expect/var
  33. 9 0
      test/files/expect/var_preset
  34. 8 0
      test/files/input/autoescape
  35. 11 0
      test/files/input/base
  36. 3 0
      test/files/input/block_super
  37. 17 0
      test/files/input/comment
  38. 7 0
      test/files/input/custom_call
  39. 12 0
      test/files/input/custom_tag
  40. 1 0
      test/files/input/custom_tag1
  41. 1 0
      test/files/input/custom_tag2
  42. 1 0
      test/files/input/custom_tag3
  43. 1 0
      test/files/input/custom_tag4
  44. 9 0
      test/files/input/cycle
  45. 5 0
      test/files/input/extend_recursive_block
  46. 3 0
      test/files/input/extends
  47. 4 0
      test/files/input/extends2
  48. 3 0
      test/files/input/extends3
  49. 3 0
      test/files/input/extends_path
  50. 6 0
      test/files/input/extends_path2
  51. 47 0
      test/files/input/filters
  52. 9 0
      test/files/input/for
  53. 3 0
      test/files/input/for_list
  54. 3 0
      test/files/input/for_list_preset
  55. 9 0
      test/files/input/for_preset
  56. 9 0
      test/files/input/for_records
  57. 15 0
      test/files/input/for_records_preset
  58. 3 0
      test/files/input/for_tuple
  59. 4 0
      test/files/input/if
  60. 4 0
      test/files/input/if_preset
  61. 43 0
      test/files/input/ifequal
  62. 43 0
      test/files/input/ifequal_preset
  63. 43 0
      test/files/input/ifnotequal
  64. 43 0
      test/files/input/ifnotequal_preset
  65. 1 0
      test/files/input/include
  66. 1 0
      test/files/input/include.html
  67. 5 0
      test/files/input/include_path
  68. 3 0
      test/files/input/include_template
  69. 11 0
      test/files/input/now
  70. 6 0
      test/files/input/path1/base1
  71. 5 0
      test/files/input/path1/base2
  72. 1 0
      test/files/input/path1/include1
  73. 5 0
      test/files/input/path1/template1
  74. 14 0
      test/files/input/path2/base2
  75. 2 0
      test/files/input/path2/template2
  76. 6 0
      test/files/input/recursive_block
  77. 1 0
      test/files/input/ssi
  78. 1 0
      test/files/input/ssi_include.html
  79. 1 0
      test/files/input/trans
  80. 5 0
      test/files/input/var
  81. 9 0
      test/files/input/var_preset

+ 15 - 0
test/erlydtl_custom_tags.erl

@@ -0,0 +1,15 @@
+-module(erlydtl_custom_tags).
+
+-export([custom1/1, custom2/2, custom3/2, custom4/1]).
+
+custom1(_TagVars = []) ->
+    <<"b1">>.
+
+custom2([], _RenderOptions = [{locale, ru}, {foo, bar}]) ->
+    <<"b2">>.
+
+custom3([], _RenderOptions = [{locale, ru}]) ->
+    <<"b3">>.
+
+custom4(_TagVars = [<<"a">>]) ->
+    <<"a">>.

+ 8 - 0
test/files/expect/autoescape

@@ -0,0 +1,8 @@
+
+    This is escaped: &lt;b&gt;bold&lt;/b&gt;
+    
+    This is not escaped: <b>bold</b>
+
+    This is escaped: &lt;b&gt;bold&lt;/b&gt;
+    
+

+ 11 - 0
test/files/expect/block_super

@@ -0,0 +1,11 @@
+base-barstring
+
+base template
+
+extending title: "base title"
+
+more of base template
+
+replacing the base content - variable: test-barstring after variable. Was: base content
+
+end of base template

+ 15 - 0
test/files/expect/comment

@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Test Comment</title>								 
+  </head>
+  <body>
+	
+	bla
+	
+        blue
+        
+        black
+  </body>
+</html>

+ 23 - 0
test/files/expect/custom_call

@@ -0,0 +1,23 @@
+>>>> before custom call tag 'comment'
+before
+
+<ul>
+
+	<li>preset-apple</li>
+
+	<li>preset-banana</li>
+
+	<li>preset-coconut</li>
+
+</ul>
+
+after
+>>>> after custom call tag 'comment'
+
+>>>> before custom call tag 'if'
+One but not two:  two 
+Two but not one:  one 
+One: 
+None: 
+
+>>>> after custom call tag 'if'

+ 33 - 0
test/files/expect/custom_tag

@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Test variable</title>								 
+  </head>
+  <body>
+	before
+	<object id="myvideo" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600">
+	<param name="movie" value="/static/mediaplayer.swf">
+    <param name="allowfullscreen" value="true">
+    <param name="menu" value="false">
+    <param name="flashvars" value="file=/myvid.mp4&image=/mypic.jpg">
+    <!--[if !IE]>-->
+    <object type="application/x-shockwave-flash" data="/static/mediaplayer.swf" width="800" height="620">
+    <param name="allowfullscreen" value="true">
+    <param name="menu" value="false">
+    <param name="flashvars" value="file=/myvid.mp4&image=/mypic.jpg">
+    <!--<![endif]-->
+    <h2>To view the Video:</h2>
+    <p>
+    	<a href="http://www.adobe.com/go/getflashplayer">
+        	<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
+    	</a>
+    </p>
+    <!--[if !IE]>-->
+    </object>
+    <!--<![endif]-->
+</object>
+
+	after
+  </body>
+</html>

+ 47 - 0
test/files/expect/cycle

@@ -0,0 +1,47 @@
+before
+
+<ul>
+
+<li>1. 1 - Apple</li>
+
+<li>2. 2 - Banana</li>
+
+<li>3. 3 - Cherry</li>
+
+<li>4. 4 - Apple</li>
+
+<li>5. 5 - Banana</li>
+
+<li>6. 6 - Cherry</li>
+
+<li>7. 7 - Apple</li>
+
+<li>8. 8 - Banana</li>
+
+<li>9. 9 - Cherry</li>
+
+<li>10. 10 - Apple</li>
+
+<li>11. 11 - Banana</li>
+
+<li>12. 12 - Cherry</li>
+
+<li>13. 13 - Apple</li>
+
+<li>14. 14 - Banana</li>
+
+<li>15. 15 - Cherry</li>
+
+<li>16. 16 - Apple</li>
+
+<li>17. 17 - Banana</li>
+
+<li>18. 18 - Cherry</li>
+
+<li>19. 19 - Apple</li>
+
+<li>20. 20 - Banana</li>
+
+</ul>
+
+after

+ 3 - 0
test/files/expect/extend_recursive_block

@@ -0,0 +1,3 @@
+
+    extended content
+

+ 11 - 0
test/files/expect/extends

@@ -0,0 +1,11 @@
+base-barstring
+
+base template
+
+replacing the base title
+
+more of base template
+
+replacing the base content - variable: test-barstring after variable 
+
+end of base template

+ 14 - 0
test/files/expect/extends_path

@@ -0,0 +1,14 @@
+base-barstring
+
+base2 template
+
+replacing the base title
+block title 2 from  base1 
+
+more of base2 template
+
+replacing the base content - variable: test-barstring after variable 
+
+block content2 in base 2, should pass through
+
+end of base2 template

+ 10 - 0
test/files/expect/extends_path2

@@ -0,0 +1,10 @@
+pre content
+
+
+start_content
+This is include1
+
+end_content
+
+
+post

+ 47 - 0
test/files/expect/filters

@@ -0,0 +1,47 @@
+
+Add: 2 + 2 = 4
+
+Capfirst: Capitalized
+
+Centered:
+<pre>
+       center       
+</pre>
+
+Date format:  Thu, 24 Jul 1975
+DateTime format: Thu, 24 Jul 1975 07:13:01
+
+Escape JS: \u0022 \u0027
+
+First letter: f
+
+Fix ampersands: &amp;
+
+Force_escape: &lt;b&gt;&lt;/b&gt;
+
+Joined: eins, zwei, drei
+
+Last: t
+
+Length: 3
+
+Length is 2?: false
+
+Left adjust: 
+<pre>
+left                
+</pre>
+
+Line breaks: Line 1<br />Line 2<br />Line 3
+
+Lowercase: lowercase
+
+Right adjust:
+<pre>
+               right
+</pre>
+
+Uppercase: UPPERCASE
+
+URL Encode: Let%27s%20go%21
+

+ 13 - 0
test/files/expect/for

@@ -0,0 +1,13 @@
+before
+
+<ul>
+
+<li>1. apple</li>
+
+<li>2. banana</li>
+
+<li>3. coconut</li>
+
+</ul>
+
+after

+ 7 - 0
test/files/expect/for_list

@@ -0,0 +1,7 @@
+
+More than one apple is called "apples". Only $1 each!
+
+More than one banana is called "bananas". Only $2 each!
+
+More than one coconut is called "coconuts". Only $500 each!
+

+ 7 - 0
test/files/expect/for_list_preset

@@ -0,0 +1,7 @@
+
+More than one apple is called "apples".
+
+More than one banana is called "bananas".
+
+More than one coconut is called "coconuts".
+

+ 13 - 0
test/files/expect/for_preset

@@ -0,0 +1,13 @@
+before
+
+<ul>
+
+	<li>preset-apple</li>
+
+	<li>preset-banana</li>
+
+	<li>preset-coconut</li>
+
+</ul>
+
+after

+ 13 - 0
test/files/expect/for_records

@@ -0,0 +1,13 @@
+before
+
+<ul>
+
+	<li><a href="http://amazon.com">Amazon</a></li>
+
+	<li><a href="http://google.com">Google</a></li>
+
+	<li><a href="http://microsoft.com">Microsoft</a></li>
+
+</ul>
+
+after

+ 23 - 0
test/files/expect/for_records_preset

@@ -0,0 +1,23 @@
+before
+
+<ul>
+
+	<li><a href="http://canon.com">Canon</a></li>
+
+	<li><a href="http://leica.com">Leica</a></li>
+
+	<li><a href="http://nikon.com">Nikon</a></li>
+
+</ul>
+
+<ul>
+
+	<li><a href="http://amazon.com">Amazon (preset)</a></li>
+
+	<li><a href="http://google.com">Google (preset)</a></li>
+
+	<li><a href="http://microsoft.com">Microsoft (preset)</a></li>
+
+</ul>
+
+after

+ 7 - 0
test/files/expect/for_tuple

@@ -0,0 +1,7 @@
+
+One apple, two apples!
+
+One banana, two bananas!
+
+One coconut, two coconuts!
+

+ 4 - 0
test/files/expect/if

@@ -0,0 +1,4 @@
+One but not two:  one 
+Two but not one:  two 
+One:  one 
+None: 

+ 4 - 0
test/files/expect/if_preset

@@ -0,0 +1,4 @@
+One but not two:  one 
+Two but not one:  two 
+One:  one 
+None: 

+ 28 - 0
test/files/expect/ifequal

@@ -0,0 +1,28 @@
+
+if: var1="foo" and var2="foo" are equal
+
+
+
+if: var1="foo" and var2="foo" are equal
+
+
+
+
+
+else: var1="foo" and var3="bar" are not equal
+
+
+
+if: "foo" and "foo" are equal
+
+
+
+else: "foo" and "bar" are not equal
+
+
+
+if: 99 and 99 are equal
+
+
+
+else: 77 and 99 are not equal

+ 28 - 0
test/files/expect/ifequal_preset

@@ -0,0 +1,28 @@
+
+if: var1="foo" and var2="foo" are equal
+
+
+
+if: var1="foo" and var2="foo" are equal
+
+
+
+
+
+else: var1="foo" and var3="bar" are not equal
+
+
+
+if: "foo" and "foo" are equal
+
+
+
+else: "foo" and "bar" are not equal
+
+
+
+if: 99 and 99 are equal
+
+
+
+else: 77 and 99 are not equal

+ 28 - 0
test/files/expect/ifnotequal

@@ -0,0 +1,28 @@
+
+
+
+else: var1="foo" and var2="foo" are not equal
+
+
+
+if: var1="foo" and var3="bar" are equal
+
+
+
+if: var1="foo" and var3="bar" are equal
+
+
+
+else: "foo" and "foo" are not equal
+
+
+
+if: "foo" and "bar" are equal
+
+
+
+else: 99 and 99 are not equal
+
+
+
+if: 77 and 99 are equal

+ 28 - 0
test/files/expect/ifnotequal_preset

@@ -0,0 +1,28 @@
+
+
+
+else: var1="foo" and var2="foo" are not equal
+
+
+
+if: var1="foo" and var3="bar" are equal
+
+
+
+if: var1="foo" and var3="bar" are equal
+
+
+
+else: "foo" and "foo" are not equal
+
+
+
+if: "foo" and "bar" are equal
+
+
+
+else: 99 and 99 are not equal
+
+
+
+if: 77 and 99 are equal

+ 2 - 0
test/files/expect/include

@@ -0,0 +1,2 @@
+Including another file: This is included! foostring1
+

+ 12 - 0
test/files/expect/include_path

@@ -0,0 +1,12 @@
+main file
+
+This is template 1.
+
+test-barstring
+
+
+This is template 2
+
+
+
+base-barstring

+ 14 - 0
test/files/expect/include_template

@@ -0,0 +1,14 @@
+Including another template: base-barstring
+
+base template
+
+base title
+
+more of base template
+
+base content
+
+end of base template
+
+
+test variable: test-barstring

+ 6 - 0
test/files/expect/recursive_block

@@ -0,0 +1,6 @@
+
+    testing: <br />
+    
+    <br />
+    end testing<br />
+

+ 2 - 0
test/files/expect/ssi

@@ -0,0 +1,2 @@
+{{ "Don't evaluate me!" }}
+

+ 1 - 0
test/files/expect/trans

@@ -0,0 +1 @@
+Example String

+ 5 - 0
test/files/expect/var

@@ -0,0 +1,5 @@
+before varriable1
+foostring1
+after variable1
+foostring2
+after variable2 (HTML-comment-wrapped)

+ 9 - 0
test/files/expect/var_preset

@@ -0,0 +1,9 @@
+one
+foostring1
+two
+preset-var1
+three
+foostring2
+four
+preset-var2
+five

+ 8 - 0
test/files/input/autoescape

@@ -0,0 +1,8 @@
+{% autoescape on %}
+    This is escaped: {{ var1 }}
+    {% autoescape off %}
+    This is not escaped: {{ var1 }}
+
+    This is escaped: {{ var1|escape }}
+    {% endautoescape %}
+{% endautoescape %}

+ 11 - 0
test/files/input/base

@@ -0,0 +1,11 @@
+{{ base_var }}
+
+base template
+
+{% block title %}base title{% endblock %}
+
+more of base template
+
+{% block content %}base content{% endblock %}
+
+end of base template

+ 3 - 0
test/files/input/block_super

@@ -0,0 +1,3 @@
+{% extends "base" %}
+{% block title %}extending title: "{{ block.super }}"{% endblock %}
+{% block content %}replacing the base content - variable: {{ test_var }} after variable. Was: {{ block.super }}{% endblock %}

+ 17 - 0
test/files/input/comment

@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Test Comment</title>								 
+  </head>
+  <body>
+	{# comment1 #}
+	bla
+	{# comment2 #}
+        blue
+        {% comment %}
+        Block Comment
+        {% endcomment %}
+        black
+  </body>
+</html>

+ 7 - 0
test/files/input/custom_call

@@ -0,0 +1,7 @@
+>>>> before custom call tag 'comment'
+{% call functional_test_for_preset %}
+>>>> after custom call tag 'comment'
+
+>>>> before custom call tag 'if'
+{% call functional_test_if with var1 %}
+>>>> after custom call tag 'if'

+ 12 - 0
test/files/input/custom_tag

@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Test variable</title>								 
+  </head>
+  <body>
+	before
+	{% flashvideo dom_id="myvideo" width="800" height="600" static="/static" path_to_video="/myvid.mp4" path_to_preview_image="/mypic.jpg" alt=_("Get Adobe Flash player") %}
+	after
+  </body>
+</html>

+ 1 - 0
test/files/input/custom_tag1

@@ -0,0 +1 @@
+{% custom1 %}

+ 1 - 0
test/files/input/custom_tag2

@@ -0,0 +1 @@
+{% custom2 %}

+ 1 - 0
test/files/input/custom_tag3

@@ -0,0 +1 @@
+{% custom3 %}

+ 1 - 0
test/files/input/custom_tag4

@@ -0,0 +1 @@
+{% custom4 "a" %}

+ 9 - 0
test/files/input/cycle

@@ -0,0 +1,9 @@
+before
+
+<ul>
+{% for i in test %}
+<li>{{ forloop.counter }}. {{ i }} - {% cycle a b c %}</li>
+{% endfor %}
+</ul>
+
+after

+ 5 - 0
test/files/input/extend_recursive_block

@@ -0,0 +1,5 @@
+{% extends "recursive_block" %}
+
+{% block content %}
+    extended content
+{% endblock %}

+ 3 - 0
test/files/input/extends

@@ -0,0 +1,3 @@
+{% extends "base" %}
+{% block title %}replacing the base title{% endblock %}
+{% block content %}replacing the base content - variable: {{ test_var }} after variable {% endblock %}

+ 4 - 0
test/files/input/extends2

@@ -0,0 +1,4 @@
+
+{% extends "base" %}
+{% block title %}replacing the base title{% endblock %}
+{% block content %}replacing the base content - variable: {{ test_var }} after variable {% endblock %}

+ 3 - 0
test/files/input/extends3

@@ -0,0 +1,3 @@
+{% extends "imaginary" %}
+{% block title %}replacing the base title{% endblock %}
+{% block content %}replacing the base content - variable: {{ test_var }} after variable {% endblock %}

+ 3 - 0
test/files/input/extends_path

@@ -0,0 +1,3 @@
+{% extends "path1/base1" %}
+{% block title %}replacing the base title{% endblock %}
+{% block content %}replacing the base content - variable: {{ test_var }} after variable {% endblock %}

+ 6 - 0
test/files/input/extends_path2

@@ -0,0 +1,6 @@
+{% extends "path1/base2" %}
+{% block content %}
+start_content
+{% include "path1/include1" %}
+end_content
+{% endblock %}

+ 47 - 0
test/files/input/filters

@@ -0,0 +1,47 @@
+{% autoescape off %}
+Add: 2 + 2 = {{ 2|add:2 }}
+
+Capfirst: {{ "capitalized"|capfirst }}
+
+Centered:
+<pre>
+{{ "center"|center:20 }}
+</pre>
+
+Date format:  {{ date_var1|date:"D, d M Y" }}
+DateTime format: {{ datetime_var1|date:"D, d M Y H:i:s" }}
+
+Escape JS: {{ "\" '"|escapejs }}
+
+First letter: {{ "first"|first }}
+
+Fix ampersands: {{ "&"|fix_ampersands }}
+
+Force_escape: {{ "<b></b>"|force_escape }}
+
+Joined: {{ list|join:", " }}
+
+Last: {{ "last"|last }}
+
+Length: {{ list|length }}
+
+Length is 2?: {{ list|length_is:2 }}
+
+Left adjust: 
+<pre>
+{{ "left"|ljust:20 }}
+</pre>
+
+Line breaks: {{ "Line 1\nLine 2\nLine 3"|linebreaksbr }}
+
+Lowercase: {{ "LOWERCASE"|lower }}
+
+Right adjust:
+<pre>
+{{ "right"|rjust:20 }}
+</pre>
+
+Uppercase: {{ "uppercase"|upper }}
+
+URL Encode: {{ "Let's go!"|urlencode }}
+{% endautoescape %}

+ 9 - 0
test/files/input/for

@@ -0,0 +1,9 @@
+before
+
+<ul>
+{% for iterator in fruit_list %}
+<li>{{ forloop.counter }}. {{ iterator }}</li>
+{% endfor %}
+</ul>
+
+after

+ 3 - 0
test/files/input/for_list

@@ -0,0 +1,3 @@
+{% for singular, plural, price in fruit_list %}
+More than one {{ singular }} is called "{{ plural }}". Only {{ price }} each!
+{% endfor %}

+ 3 - 0
test/files/input/for_list_preset

@@ -0,0 +1,3 @@
+{% for singular, plural in fruit_list %}
+More than one {{ singular }} is called "{{ plural }}".
+{% endfor %}

+ 9 - 0
test/files/input/for_preset

@@ -0,0 +1,9 @@
+before
+
+<ul>
+{% for iterator in fruit_list %}
+	<li>{{ iterator }}</li>
+{% endfor %}
+</ul>
+
+after

+ 9 - 0
test/files/input/for_records

@@ -0,0 +1,9 @@
+before
+
+<ul>
+{% for iterator in link_list %}
+	<li><a href="{{ iterator.url }}">{{ iterator.name }}</a></li>
+{% endfor %}
+</ul>
+
+after

+ 15 - 0
test/files/input/for_records_preset

@@ -0,0 +1,15 @@
+before
+
+<ul>
+{% for iterator in photo_links %}
+	<li><a href="{{ iterator.url }}">{{ iterator.name }}</a></li>
+{% endfor %}
+</ul>
+
+<ul>
+{% for iterator in software_links %}
+	<li><a href="{{ iterator.url }}">{{ iterator.name }}</a></li>
+{% endfor %}
+</ul>
+
+after

+ 3 - 0
test/files/input/for_tuple

@@ -0,0 +1,3 @@
+{% for singular, plural in fruit_list %}
+One {{ singular }}, two {{ plural }}!
+{% endfor %}

+ 4 - 0
test/files/input/if

@@ -0,0 +1,4 @@
+One but not two: {% if var1 %} one {% else %} two {% endif %}
+Two but not one: {% if not var1 %} one {% else %} two {% endif %}
+One: {% if var1 %} one {% endif %}
+None: {% if var2 %} one {% endif %}

+ 4 - 0
test/files/input/if_preset

@@ -0,0 +1,4 @@
+One but not two: {% if var1 %} one {% else %} two {% endif %}
+Two but not one: {% if not var1 %} one {% else %} two {% endif %}
+One: {% if var1 %} one {% endif %}
+None: {% if var2 %} one {% endif %}

+ 43 - 0
test/files/input/ifequal

@@ -0,0 +1,43 @@
+{% ifequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% endifequal %}
+
+{% ifequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% else %}
+else: var1="foo" and var2="foo" are not equal
+{% endifequal %}
+
+{% ifequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% endifequal %}
+
+{% ifequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% else %}
+else: var1="foo" and var3="bar" are not equal
+{% endifequal %}
+
+{% ifequal "foo" "foo" %}
+if: "foo" and "foo" are equal
+{% else %}
+else: "foo" and "foo" are not equal
+{% endifequal %}
+
+{% ifequal "foo" "bar" %}
+if: "foo" and "bar" are equal
+{% else %}
+else: "foo" and "bar" are not equal
+{% endifequal %}
+
+{% ifequal 99 99 %}
+if: 99 and 99 are equal
+{% else %}
+else: 99 and 99 are not equal
+{% endifequal %}
+
+{% ifequal 77 99 %}
+if: 77 and 99 are equal
+{% else %}
+else: 77 and 99 are not equal
+{% endifequal %}

+ 43 - 0
test/files/input/ifequal_preset

@@ -0,0 +1,43 @@
+{% ifequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% endifequal %}
+
+{% ifequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% else %}
+else: var1="foo" and var2="foo" are not equal
+{% endifequal %}
+
+{% ifequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% endifequal %}
+
+{% ifequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% else %}
+else: var1="foo" and var3="bar" are not equal
+{% endifequal %}
+
+{% ifequal "foo" "foo" %}
+if: "foo" and "foo" are equal
+{% else %}
+else: "foo" and "foo" are not equal
+{% endifequal %}
+
+{% ifequal "foo" "bar" %}
+if: "foo" and "bar" are equal
+{% else %}
+else: "foo" and "bar" are not equal
+{% endifequal %}
+
+{% ifequal 99 99 %}
+if: 99 and 99 are equal
+{% else %}
+else: 99 and 99 are not equal
+{% endifequal %}
+
+{% ifequal 77 99 %}
+if: 77 and 99 are equal
+{% else %}
+else: 77 and 99 are not equal
+{% endifequal %}

+ 43 - 0
test/files/input/ifnotequal

@@ -0,0 +1,43 @@
+{% ifnotequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% else %}
+else: var1="foo" and var2="foo" are not equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% else %}
+else: var1="foo" and var3="bar" are not equal
+{% endifnotequal %}
+
+{% ifnotequal "foo" "foo" %}
+if: "foo" and "foo" are equal
+{% else %}
+else: "foo" and "foo" are not equal
+{% endifnotequal %}
+
+{% ifnotequal "foo" "bar" %}
+if: "foo" and "bar" are equal
+{% else %}
+else: "foo" and "bar" are not equal
+{% endifnotequal %}
+
+{% ifnotequal 99 99 %}
+if: 99 and 99 are equal
+{% else %}
+else: 99 and 99 are not equal
+{% endifnotequal %}
+
+{% ifnotequal 77 99 %}
+if: 77 and 99 are equal
+{% else %}
+else: 77 and 99 are not equal
+{% endifnotequal %}

+ 43 - 0
test/files/input/ifnotequal_preset

@@ -0,0 +1,43 @@
+{% ifnotequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var2 %}
+if: var1="foo" and var2="foo" are equal
+{% else %}
+else: var1="foo" and var2="foo" are not equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% endifnotequal %}
+
+{% ifnotequal var1 var3 %}
+if: var1="foo" and var3="bar" are equal
+{% else %}
+else: var1="foo" and var3="bar" are not equal
+{% endifnotequal %}
+
+{% ifnotequal "foo" "foo" %}
+if: "foo" and "foo" are equal
+{% else %}
+else: "foo" and "foo" are not equal
+{% endifnotequal %}
+
+{% ifnotequal "foo" "bar" %}
+if: "foo" and "bar" are equal
+{% else %}
+else: "foo" and "bar" are not equal
+{% endifnotequal %}
+
+{% ifnotequal 99 99 %}
+if: 99 and 99 are equal
+{% else %}
+else: 99 and 99 are not equal
+{% endifnotequal %}
+
+{% ifnotequal 77 99 %}
+if: 77 and 99 are equal
+{% else %}
+else: 77 and 99 are not equal
+{% endifnotequal %}

+ 1 - 0
test/files/input/include

@@ -0,0 +1 @@
+Including another file: {% include "include.html" with var1=var1 only %}

+ 1 - 0
test/files/input/include.html

@@ -0,0 +1 @@
+This is included! {{ var1 }}

+ 5 - 0
test/files/input/include_path

@@ -0,0 +1,5 @@
+main file
+
+{% ssi "path1/template1" parsed %}
+
+{{ base_var }}

+ 3 - 0
test/files/input/include_template

@@ -0,0 +1,3 @@
+Including another template: {% include "base" %}
+
+test variable: {{ test_var }}

+ 11 - 0
test/files/input/now

@@ -0,0 +1,11 @@
+Expected format : Thu, 21 Dec 2000 16:01:07 +0200
+Got : {% now "r" %}
+
+Expected format : 27th February 2008 01:24
+Got : {% now "jS F Y H:i" %}
+
+Expected format : It is the 4th of September 2007
+Got : It is the {% now "jS o\f F Y" %}
+
+Expected format : ''
+Got : '{% now "" %}'

+ 6 - 0
test/files/input/path1/base1

@@ -0,0 +1,6 @@
+{% extends "path2/base2" %}
+
+{% block title2 %}block title 2 from  base1 {% endblock %}
+
+
+

+ 5 - 0
test/files/input/path1/base2

@@ -0,0 +1,5 @@
+pre content
+
+{% block content %}default content{% endblock %}
+
+post

+ 1 - 0
test/files/input/path1/include1

@@ -0,0 +1 @@
+This is include1

+ 5 - 0
test/files/input/path1/template1

@@ -0,0 +1,5 @@
+This is template 1.
+
+{{ test_var }}
+
+{% include "path2/template2" %}

+ 14 - 0
test/files/input/path2/base2

@@ -0,0 +1,14 @@
+{{ base_var }}
+
+base2 template
+
+{% block title %}block title in base2, should be hidden by main template{% endblock %}
+{% block title2 %}block title2 in base2, should be hidden by base1{% endblock %}
+
+more of base2 template
+
+{% block content %}block content in base 2, should be overwritten{% endblock %}
+
+{% block content2 %}block content2 in base 2, should pass through{% endblock %}
+
+end of base2 template

+ 2 - 0
test/files/input/path2/template2

@@ -0,0 +1,2 @@
+
+This is template 2

+ 6 - 0
test/files/input/recursive_block

@@ -0,0 +1,6 @@
+{% block content %}
+    testing: <br />
+    {% block content %}{% endblock %}
+    <br />
+    end testing<br />
+{% endblock %}

+ 1 - 0
test/files/input/ssi

@@ -0,0 +1 @@
+{% ssi path %}

+ 1 - 0
test/files/input/ssi_include.html

@@ -0,0 +1 @@
+{{ "Don't evaluate me!" }}

+ 1 - 0
test/files/input/trans

@@ -0,0 +1 @@
+{% trans "Example String" %}

+ 5 - 0
test/files/input/var

@@ -0,0 +1,5 @@
+before varriable1
+{{ var1 }}
+after variable1
+<!--{{ var2 }}-->
+after variable2 (HTML-comment-wrapped)

+ 9 - 0
test/files/input/var_preset

@@ -0,0 +1,9 @@
+one
+{{ var1 }}
+two
+{{ preset_var1 }}
+three
+<!--{{ var2 }}-->
+four
+{{ preset_var2 }}
+five