aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template/templates
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2008-10-15 16:21:27 +0000
committerChris Smith <toonarmy@phpbb.com>2008-10-15 16:21:27 +0000
commit69cfb5b821cdb2676d4d5a10943dc1550d1ad168 (patch)
tree4e06795f5600727e1426eaf1f02ac0f8d32e84ae /tests/template/templates
parentbaf8d571e3fe64a4dc39717f187abfc2bd0fb637 (diff)
downloadforums-69cfb5b821cdb2676d4d5a10943dc1550d1ad168.tar
forums-69cfb5b821cdb2676d4d5a10943dc1550d1ad168.tar.gz
forums-69cfb5b821cdb2676d4d5a10943dc1550d1ad168.tar.bz2
forums-69cfb5b821cdb2676d4d5a10943dc1550d1ad168.tar.xz
forums-69cfb5b821cdb2676d4d5a10943dc1550d1ad168.zip
Initial template tests, a bit hackish currently, excuse the rushed nature of this commit got to catch a train :)
git-svn-id: file:///svn/phpbb/trunk@9020 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'tests/template/templates')
-rw-r--r--tests/template/templates/basic.html18
-rw-r--r--tests/template/templates/define.html11
-rw-r--r--tests/template/templates/expressions.html85
-rw-r--r--tests/template/templates/if.html5
-rw-r--r--tests/template/templates/loop.html11
-rw-r--r--tests/template/templates/loop_vars.html9
-rw-r--r--tests/template/templates/variable.html1
7 files changed, 140 insertions, 0 deletions
diff --git a/tests/template/templates/basic.html b/tests/template/templates/basic.html
new file mode 100644
index 0000000000..1a3fd5a96a
--- /dev/null
+++ b/tests/template/templates/basic.html
@@ -0,0 +1,18 @@
+<!-- IF S_FALSE -->
+fail
+<!-- ENDIF -->
+<!-- IF S_TRUE -->
+pass
+<!-- ENDIF -->
+<!-- IF S_FALSE -->
+fail
+<!-- ELSEIF S_FALSE and not S_TRUE -->
+fail
+<!-- ELSE -->
+pass
+<!-- ENDIF -->
+<!-- BEGIN empty -->
+fail
+<!-- BEGINELSE -->
+pass
+<!-- END empty -->
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
new file mode 100644
index 0000000000..94741e53fc
--- /dev/null
+++ b/tests/template/templates/define.html
@@ -0,0 +1,11 @@
+<!-- DEFINE $VALUE = 'xyz' -->
+
+{$VALUE}
+
+<!-- DEFINE $VALUE = 'abc' -->
+
+{$VALUE}
+
+<!-- UNDEFINE $VALUE -->
+
+{$VALUE}
diff --git a/tests/template/templates/expressions.html b/tests/template/templates/expressions.html
new file mode 100644
index 0000000000..c70dc9418c
--- /dev/null
+++ b/tests/template/templates/expressions.html
@@ -0,0 +1,85 @@
+<!-- IF 10 is even -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 is even -->fail<!-- ELSE -->pass<!-- ENDIF -->
+
+<!-- IF not 390 is even -->fail<!-- ELSE -->pass<!-- ENDIF -->
+
+<!-- IF 9 is odd -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 32 is odd -->fail<!-- ELSE -->pass<!-- ENDIF -->
+
+
+<!-- IF 24 == 24 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 24 eq 24 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF ((((((24 == 24)))))) -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 24 != 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 24 <> 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 24 ne 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 24 neq 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 10 lt 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 10 < 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 10 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 10 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 10 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 20 le 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 20 lte 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 20 <= 20 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 9 gt 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 > 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 9 >= 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 gte 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 ge 1 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 >= 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 gte 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 9 ge 9 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF true && (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF true and (10 > 4) -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF false || true -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF false or true -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF !false -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF !! true -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF not false -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF not not not false -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+
+<!-- IF 6 % 4 == 2 -->pass<!-- ELSE -->fail<!-- ENDIF -->
+
+<!-- IF 24 mod 12 == 0 -->pass<!-- ELSE -->fail<!-- ENDIF -->
diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html
new file mode 100644
index 0000000000..d8343c4391
--- /dev/null
+++ b/tests/template/templates/if.html
@@ -0,0 +1,5 @@
+<!-- IF S_VALUE -->
+1
+<!-- ELSE -->
+0
+<!-- ENDIF -->
diff --git a/tests/template/templates/loop.html b/tests/template/templates/loop.html
new file mode 100644
index 0000000000..ae921fc929
--- /dev/null
+++ b/tests/template/templates/loop.html
@@ -0,0 +1,11 @@
+<!-- BEGIN loop -->
+loop
+<!-- BEGINELSE -->
+noloop
+<!-- END loop -->
+
+<!-- IF .loop -->
+loop
+<!-- ELSE -->
+noloop
+<!-- ENDIF -->
diff --git a/tests/template/templates/loop_vars.html b/tests/template/templates/loop_vars.html
new file mode 100644
index 0000000000..0da0af4758
--- /dev/null
+++ b/tests/template/templates/loop_vars.html
@@ -0,0 +1,9 @@
+<!-- BEGIN loop -->
+<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF -->
+
+{loop.S_ROW_COUNT}
+
+{loop.VARIABLE}
+
+<!-- IF loop.S_LAST_ROW -->last<!-- ENDIF -->
+<!-- END loop -->
diff --git a/tests/template/templates/variable.html b/tests/template/templates/variable.html
new file mode 100644
index 0000000000..f68f91597c
--- /dev/null
+++ b/tests/template/templates/variable.html
@@ -0,0 +1 @@
+{VARIABLE}