summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt')
-rw-r--r--www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt b/www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt
new file mode 100644
index 00000000..b1fb9651
--- /dev/null
+++ b/www/wiki/extensions/ParserFunctions/tests/parser/stringFunctionTests.txt
@@ -0,0 +1,50 @@
+# @todo expand
+!! functionhooks
+len
+!! endfunctionhooks
+
+!! test
+#len
+!! input
+{{#len:}}
+{{#len:0}}
+{{#len:test}}
+!!result
+<p>0
+1
+4
+</p>
+!! end
+
+!! test
+#urldecode
+!! input
+{{#urldecode:}}
+{{#urldecode:foo%20bar}}
+{{#urldecode:%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%92%D0%B8%D0%BA%D0%B8}}
+{{#urldecode: some unescaped string}}
+!! result
+<p>foo bar
+МедиаВики
+some unescaped string
+</p>
+!! end
+
+!! test
+#pos
+!! input
+{{#pos:Žmržlina|žlina}}
+{{#pos:stringstring|str|4}}
+!! result
+<p>3
+6
+</p>
+!! end
+
+!! test
+#pos with too large offset (T209600)
+!! input
+{{#pos:FooBar|Foo|32}}
+!! result
+
+!! end