FANDOM


Testharness report for String.

This is the unit test report for String, which produces integrity checks and output for debugging String.

Purge
Test suite statusPassed
Scribunto test cases115/115
Code coverage26/28
Unit test report for String.
  • Test members missing: htmldecodehtmlencode
  • Test cases failing: none
  • Execution time: 10ms

Scribunto test cases

str.urldecode

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|urldecode|x%3Ay%2Fz+%C3%A1+%C3%A9}}
x:y/z á éx:y/z á é
Passing
{{#invoke:string|urldecode|x%3Ay%2Fz+%C3%A1+%C3%A9|QUERY}}
x:y/z á éx:y/z á é
Passing
{{#invoke:string|urldecode|x%3Ay%2Fz_%C3%A1_%C3%A9|WIKI}}
x:y/z á éx:y/z á é
Passing
{{#invoke:string|urldecode|x%3Ay%2Fz%20%C3%A1%20%C3%A9|PATH}}
x:y/z á éx:y/z á é

str.urlencode

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|urlencode|x:y/z á é}}
x%3Ay%2Fz+%C3%A1+%C3%A9x%3Ay%2Fz+%C3%A1+%C3%A9
Passing
{{#invoke:string|urlencode|x:y/z á é|QUERY}}
x%3Ay%2Fz+%C3%A1+%C3%A9x%3Ay%2Fz+%C3%A1+%C3%A9
Passing
{{#invoke:string|urlencode|x:y/z á é|WIKI}}
x%3Ay%2Fz_%C3%A1_%C3%A9x%3Ay%2Fz_%C3%A1_%C3%A9
Passing
{{#invoke:string|urlencode|x:y/z á é|PATH}}
x%3Ay%2Fz%20%C3%A1%20%C3%A9x%3Ay%2Fz%20%C3%A1%20%C3%A9

str.explode

6/6
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|explode|And if you tolerate this| |2}}
youyou
Passing
{{#invoke:string|explode|String/Functions/Code|/|-1}}
CodeCode
Passing
{{#invoke:string|explode|Split%By%Percentage%Signs|%|2}}
PercentagePercentage
Passing
{{#invoke:string|explode|And if you tolerate this| |2|3}}
you tolerate thisyou tolerate this
Passing
{{#invoke:string|explode|And if you tolerate this| |-1|3}}
you tolerate thisyou tolerate this
Passing
{{#invoke:string|explode|Žmržlina|ž|1}}
linalina

str.match

7/7
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|match|dog (cat)|%((%a-)%)}}
catcat
Passing
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)||-1}}
fishfish
Passing
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)||2}}
canarycanary
Passing
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)|6|1}}
canarycanary
Passing
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)|6|2}}
fishfish
Passing
{{#invoke:string|match|dog (cat)|%((%a-)%)||2|no_category=true}}
String Module Error: match not foundString Module Error: match not found
Passing
{{#invoke:string|match|dog (cat)|%((%a-)%)||2|ignore_errors=true}}

str.str_find

27/27
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|str_find}}
11
Passing
{{#invoke:string|str_find|1=}}
11
Passing
{{#invoke:string|str_find|1=|2=}}
11
Passing
{{#invoke:string|str_find|abc|}}
11
Passing
{{#invoke:string|str_find|bbc|z}}
-1-1
Passing
{{#invoke:string|str_find|bbc|zz}}
-1-1
Passing
{{#invoke:string|str_find|bbc|bb}}
11
Passing
{{#invoke:string|str_find|abc|b}}
22
Passing
{{#invoke:string|str_find|abb|bb}}
22
Passing
{{#invoke:string|str_find|Bob|}}
11
Passing
{{#invoke:string|str_find||Bob}}
-1-1
Passing
{{#invoke:string|str_find|Bob|Joe}}
-1-1
Passing
{{#invoke:string|str_find|Bob|Joe}}
-1-1
Passing
{{#invoke:string|str_find|BobBob|bB}}
33
Passing
{{#invoke:string|str_find|Bob|B|}}
11
Passing
{{#invoke:string|str_find|Bob|o|}}
22
Passing
{{#invoke:string|str_find|Bob|b|}}
33
Passing
{{#invoke:string|str_find|o|Bob}}
-1-1
Passing
{{#invoke:string|str_find| Bob |o}}
33
Passing
{{#invoke:string|str_find| Bob Jones |b J}}
44
Passing
{{#invoke:string|str_find|aaa aaa| a}}
44
Passing
{{#invoke:string|str_find|aaa aaa|a }}
33
Passing
{{#invoke:string|str_find|높지만 급격히|만}}
33
Passing
{{#invoke:string|str_find|test test| }}
55
Passing
{{#invoke:string|str_find|test test| }}
-1-1
Passing
{{#invoke:string|str_find|test test|2= }}
11
Passing
{{#invoke:string|str_find|test test|2= }}
-1-1

str.prefix

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|prefix|aabbcc|a}}
yesyes
Passing
{{#invoke:string|prefix|aabbcc|c}}
nono

str.suffix

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|suffix|aabbcc|c}}
yesyes
Passing
{{#invoke:string|suffix|aabbcc|a}}
nono

str.replace

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|replace|1.1.1.1|.|/}}
1/1/1/11/1/1/1
Passing
{{#invoke:string|replace|alpha (beta)| (| gamma (}}
alpha gamma (beta)alpha gamma (beta)
Passing
{{#invoke:string|replace|Dog (cat)|%s%(.*%)||plain=false}}
DogDog

str.sub

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|sub| foo |2|4}}
foofoo
Passing
{{#invoke:string|sub|s= foo |1|3}}
foofoo
Passing
{{#invoke:string|sub|最近の更新|4|5}}
更新更新

str.ucfirst

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|ucfirst|iNPUT STRING}}
INPUT STRINGINPUT STRING
Passing
{{#invoke:string|ucfirst|łódź}}
ŁódźŁódź

str.padleft

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|padleft|input string}}
input stringinput string
Passing
{{#invoke:string|padleft|input string|16}}
input string input string
Passing
{{#invoke:string|padleft|input string|16|>}}
>>>>input string>>>>input string

str.lc

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|lc|INPUT STRING}}
input stringinput string
Passing
{{#invoke:string|lc|Województwo Łódzkie}}
województwo łódzkiewojewództwo łódzkie

str.find

18/18
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|find}}
00
Passing
{{#invoke:string|find|source=}}
00
Passing
{{#invoke:string|find|source=|target=}}
00
Passing
{{#invoke:string|find|source=|target=Bob}}
00
Passing
{{#invoke:string|find|abc123def|12}}
44
Passing
{{#invoke:string|find|Bob|Joe}}
00
Passing
{{#invoke:string|find|Bob|b}}
33
Passing
{{#invoke:string|find|Bob Joe|oe}}
66
Passing
{{#invoke:string|find|source = abc123def| target = 12}}
44
Passing
{{#invoke:string|find|source = abc123def| target = pqr}}
00
Passing
{{#invoke:string|find| abc123def |123}}
55
Passing
{{#invoke:string|find|source = abc123def|target = %d |start = 3 |plain = false}}
44
Passing
{{#invoke:string|find|source= Bob |o}}
22
Passing
{{#invoke:string|find| Bob |o}}
33
Passing
{{#invoke:string|find|높지만 급격히|만}}
33
Passing
{{#invoke:string|find|source=BAAAB|target=%w|plain=false}}
11
Passing
{{#invoke:string|find|source=BAAAB|target=%w|start=3|plain=false}}
33
Passing
{{#invoke:string|find|source=BAAAB|target=(%w)%1|plain=false}}
22

str.padright

3/3
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|padright|input string}}
input stringinput string
Passing
{{#invoke:string|padright|input string|16}}
input string input string
Passing
{{#invoke:string|padright|input string|16|<}}
input string<<<<input string<<<<

str.lcfirst

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|lcfirst|Input string}}
input stringinput string
Passing
{{#invoke:string|lcfirst|Łódź}}
łódźłódź

str.sublength

7/7
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|sublength| 1234567 |3|2}}
3434
Passing
{{#invoke:string|sublength|s = 1234567| i = 3| len = 2}}
4545
Passing
{{#invoke:string|sublength| alphabet |1|5}}
alphaalpha
Passing
{{#invoke:string|sublength|s = alphabet|i = 0|len = 5}}
alphaalpha
Passing
{{#invoke:string|sublength|alph abet|0|5}}
alph alph
Passing
{{#invoke:string|sublength| three words here |2|10}}
hree wordshree words
Passing
{{#invoke:string|sublength|s = three words here |i = 3|len = 10}}
ee words hee words h

str.main

1/1
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|main}}
Error
you must specify a function to call
Error
you must specify a function to call

str.rep

5/5
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|rep|abc|1}}
abcabc
Passing
{{#invoke:string|rep|a b|7}}
a ba ba ba ba ba ba ba ba ba ba ba ba ba b
Passing
{{#invoke:string|rep|bla|glug|no_category=true}}
String Module Error: function rep expects a number as second parameter, received "glug"String Module Error: function rep expects a number as second parameter, received "glug"
Passing
{{#invoke:string|rep|bla|glug|ignore_errors=true}}
Passing
{{#invoke:string|rep|àèò|3}}
àèòàèòàèòàèòàèòàèò

str.uc

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|uc|input string}}
INPUT STRINGINPUT STRING
Passing
{{#invoke:string|uc|Województwo Łódzkie}}
WOJEWÓDZTWO ŁÓDZKIEWOJEWÓDZTWO ŁÓDZKIE

str.len

6/6
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|len| foo }}
55
Passing
{{#invoke:string|len|s= foo }}
33
Passing
{{#invoke:string|len}}
00
Passing
{{#invoke:string|len|s=}}
00
Passing
{{#invoke:string|len|   }}
33
Passing
{{#invoke:string|len|最近の更新}}
55

str.count

4/4
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|count|aabbcc|a}}
22
Passing
{{#invoke:string|count|aabbcc|[ac]|plain=false}}
44
Passing
{{#invoke:string|count|aaabaaac|[^a]|plain=false}}
22
Passing
{{#invoke:string|count|aaabaaac|^a|plain=false}}
11

str.pos

2/2
StatusCodeExpectedActualDiffers at
Passing
{{#invoke:string|pos|abcdefghi | 4 }}
dd
Passing
{{#invoke:string|pos|target = abcdefghi |pos = 4}}
dd
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+