Debian Codegraph @

extensions/ParserFunctions/tests/parser/stringFunctionTests.txt

raw
1 !! Version 2
2 # Force the test runner to ensure the extension is loaded
3 # Use '#switch' to do the detection, since we might not have
4 # string functions enabled (yet) -- they are force-enabled on a per-test
5 # basis by the ParserTestGlobals hook.
6 !! functionhooks
7 switch
8 !! endfunctionhooks
9
10 # @todo expand
11
12 !! test
13 #len
14 !! wikitext
15 {{#len:}}
16 {{#len:0}}
17 {{#len:test}}
18 !! html
19 <p>0
20 1
21 4
22 </p>
23 !! end
24
25 !! test
26 #urldecode
27 !! wikitext
28 {{#urldecode:}}
29 {{#urldecode:foo%20bar}}
30 {{#urldecode:%D0%9C%D0%B5%D0%B4%D0%B8%D0%B0%D0%92%D0%B8%D0%BA%D0%B8}}
31 {{#urldecode: some unescaped string}}
32 !! html
33 <p>foo bar
34 МедиаВики
35 some unescaped string
36 </p>
37 !! end
38
39 !! test
40 #pos
41 !! wikitext
42 {{#pos:Žmržlina|žlina}}
43 {{#pos:stringstring|str|4}}
44 !! html
45 <p>3
46 6
47 </p>
48 !! end
49
50 !! test
51 #pos with too large offset (T209600)
52 !! wikitext
53 {{#pos:FooBar|Foo|32}}
54 !! html
55
56 !! end
57
58 !! test
59 #explode with negative offset (T403241)
60 !! wikitext
61 {{#explode:Foo*Bar|*|-1}}
62 !! html
63 <p>Bar
64 </p>
65 !! end
66
67 !! test
68 #explode with bad negative offset (T403241)
69 !! wikitext
70 {{#explode:Foo*Bar|*|- 1}}
71 !! html
72
73 !! end