Testharness report for String.
This is the unit test report for String, which produces integrity checks and output for debugging String.
| Test suite status | |
|---|---|
| Scribunto test cases | |
| Code coverage |
Unit test report for String.
- Test members missing:
htmldecode•htmlencode - Test cases failing: none
- Execution time: 2.8ms
Scribunto test cases
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|urldecode|x%3Ay%2Fz+%C3%A1+%C3%A9}} | x:y/z á é | x:y/z á é | ||
{{#invoke:string|urldecode|x%3Ay%2Fz+%C3%A1+%C3%A9|QUERY}} | x:y/z á é | x:y/z á é | ||
{{#invoke:string|urldecode|x%3Ay%2Fz_%C3%A1_%C3%A9|WIKI}} | x:y/z á é | x:y/z á é | ||
{{#invoke:string|urldecode|x%3Ay%2Fz%20%C3%A1%20%C3%A9|PATH}} | x:y/z á é | x:y/z á é | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|urlencode|x:y/z á é}} | x%3Ay%2Fz+%C3%A1+%C3%A9 | x%3Ay%2Fz+%C3%A1+%C3%A9 | ||
{{#invoke:string|urlencode|x:y/z á é|QUERY}} | x%3Ay%2Fz+%C3%A1+%C3%A9 | x%3Ay%2Fz+%C3%A1+%C3%A9 | ||
{{#invoke:string|urlencode|x:y/z á é|WIKI}} | x:y/z_%C3%A1_%C3%A9 | x:y/z_%C3%A1_%C3%A9 | ||
{{#invoke:string|urlencode|x:y/z á é|PATH}} | x%3Ay%2Fz%20%C3%A1%20%C3%A9 | x%3Ay%2Fz%20%C3%A1%20%C3%A9 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|explode|And if you tolerate this| |2}} | you | you | ||
{{#invoke:string|explode|String/Functions/Code|/|-1}} | Code | Code | ||
{{#invoke:string|explode|Split%By%Percentage%Signs|%|2}} | Percentage | Percentage | ||
{{#invoke:string|explode|And if you tolerate this| |2|3}} | you tolerate this | you tolerate this | ||
{{#invoke:string|explode|And if you tolerate this| |-1|3}} | you tolerate this | you tolerate this | ||
{{#invoke:string|explode|Žmržlina|ž|1}} | lina | lina | ||
{{#invoke:string|explode|Explode with an empty delimiter||2}} | p | p | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|match|dog (cat)|%((%a-)%)}} | cat | cat | ||
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)||-1}} | fish | fish | ||
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)||2}} | canary | canary | ||
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)|6|1}} | canary | canary | ||
{{#invoke:string|match|dog (cat) (canary) (fish)|%((%a-)%)|6|2}} | fish | fish | ||
{{#invoke:string|match|dog (cat)|%((%a-)%)||2|no_category=true}} | String Module Error: match not found | String Module Error: match not found | ||
{{#invoke:string|match|dog (cat)|%((%a-)%)||2|ignore_errors=true}} | ||||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|str_find}} | 1 | 1 | ||
{{#invoke:string|str_find|1=}} | 1 | 1 | ||
{{#invoke:string|str_find|1=|2=}} | 1 | 1 | ||
{{#invoke:string|str_find|abc|}} | 1 | 1 | ||
{{#invoke:string|str_find|bbc|z}} | -1 | -1 | ||
{{#invoke:string|str_find|bbc|zz}} | -1 | -1 | ||
{{#invoke:string|str_find|bbc|bb}} | 1 | 1 | ||
{{#invoke:string|str_find|abc|b}} | 2 | 2 | ||
{{#invoke:string|str_find|abb|bb}} | 2 | 2 | ||
{{#invoke:string|str_find|Bob|}} | 1 | 1 | ||
{{#invoke:string|str_find||Bob}} | -1 | -1 | ||
{{#invoke:string|str_find|Bob|Joe}} | -1 | -1 | ||
{{#invoke:string|str_find|Bob|Joe}} | -1 | -1 | ||
{{#invoke:string|str_find|BobBob|bB}} | 3 | 3 | ||
{{#invoke:string|str_find|Bob|B|}} | 1 | 1 | ||
{{#invoke:string|str_find|Bob|o|}} | 2 | 2 | ||
{{#invoke:string|str_find|Bob|b|}} | 3 | 3 | ||
{{#invoke:string|str_find|o|Bob}} | -1 | -1 | ||
{{#invoke:string|str_find| Bob |o}} | 3 | 3 | ||
{{#invoke:string|str_find| Bob Jones |b J}} | 4 | 4 | ||
{{#invoke:string|str_find|aaa aaa| a}} | 4 | 4 | ||
{{#invoke:string|str_find|aaa aaa|a }} | 3 | 3 | ||
{{#invoke:string|str_find|높지만 급격히|만}} | 3 | 3 | ||
{{#invoke:string|str_find|test test| }} | 5 | 5 | ||
{{#invoke:string|str_find|test test| }} | -1 | -1 | ||
{{#invoke:string|str_find|test test|2= }} | 1 | 1 | ||
{{#invoke:string|str_find|test test|2= }} | -1 | -1 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|prefix|aabbcc|a}} | yes | yes | ||
{{#invoke:string|prefix|aabbcc|c}} | no | no | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|suffix|aabbcc|c}} | yes | yes | ||
{{#invoke:string|suffix|aabbcc|a}} | no | no | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|replace|1.1.1.1|.|/}} | 1/1/1/1 | 1/1/1/1 | ||
{{#invoke:string|replace|alpha (beta)| (| gamma (}} | alpha gamma (beta) | alpha gamma (beta) | ||
{{#invoke:string|replace|Dog (cat)|%s%(.*%)||plain=false}} | Dog | Dog | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|sub| foo |2|4}} | foo | foo | ||
{{#invoke:string|sub|s= foo |1|3}} | foo | foo | ||
{{#invoke:string|sub|最近の更新|4|5}} | 更新 | 更新 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|ucfirst|iNPUT STRING}} | INPUT STRING | INPUT STRING | ||
{{#invoke:string|ucfirst|łódź}} | Łódź | Łódź | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|padleft|input string}} | input string | input string | ||
{{#invoke:string|padleft|input string|16}} | input string | input string | ||
{{#invoke:string|padleft|input string|16|>}} | >>>>input string | >>>>input string | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|lc|INPUT STRING}} | input string | input string | ||
{{#invoke:string|lc|Województwo Łódzkie}} | województwo łódzkie | województwo łódzkie | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|find}} | 0 | 0 | ||
{{#invoke:string|find|source=}} | 0 | 0 | ||
{{#invoke:string|find|source=|target=}} | 0 | 0 | ||
{{#invoke:string|find|source=|target=Bob}} | 0 | 0 | ||
{{#invoke:string|find|abc123def|12}} | 4 | 4 | ||
{{#invoke:string|find|Bob|Joe}} | 0 | 0 | ||
{{#invoke:string|find|Bob|b}} | 3 | 3 | ||
{{#invoke:string|find|Bob Joe|oe}} | 6 | 6 | ||
{{#invoke:string|find|source = abc123def| target = 12}} | 4 | 4 | ||
{{#invoke:string|find|source = abc123def| target = pqr}} | 0 | 0 | ||
{{#invoke:string|find| abc123def |123}} | 5 | 5 | ||
{{#invoke:string|find|source = abc123def|target = %d |start = 3 |plain = false}} | 4 | 4 | ||
{{#invoke:string|find|source= Bob |o}} | 2 | 2 | ||
{{#invoke:string|find| Bob |o}} | 3 | 3 | ||
{{#invoke:string|find|높지만 급격히|만}} | 3 | 3 | ||
{{#invoke:string|find|source=BAAAB|target=%w|plain=false}} | 1 | 1 | ||
{{#invoke:string|find|source=BAAAB|target=%w|start=3|plain=false}} | 3 | 3 | ||
{{#invoke:string|find|source=BAAAB|target=(%w)%1|plain=false}} | 2 | 2 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|padright|input string}} | input string | input string | ||
{{#invoke:string|padright|input string|16}} | input string | input string | ||
{{#invoke:string|padright|input string|16|<}} | input string<<<< | input string<<<< | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|lcfirst|Input string}} | input string | input string | ||
{{#invoke:string|lcfirst|Łódź}} | łódź | łódź | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|sublength| 1234567 |3|2}} | 34 | 34 | ||
{{#invoke:string|sublength|s = 1234567| i = 3| len = 2}} | 45 | 45 | ||
{{#invoke:string|sublength| alphabet |1|5}} | alpha | alpha | ||
{{#invoke:string|sublength|s = alphabet|i = 0|len = 5}} | alpha | alpha | ||
{{#invoke:string|sublength|alph abet|0|5}} | alph | alph | ||
{{#invoke:string|sublength| three words here |2|10}} | hree words | hree words | ||
{{#invoke:string|sublength|s = three words here |i = 3|len = 10}} | ee words h | ee words h | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|main}} | you must specify a function to call | you must specify a function to call | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|rep|abc|1}} | abc | abc | ||
{{#invoke:string|rep|a b|7}} | a ba ba ba ba ba ba b | a ba ba ba ba ba ba b | ||
{{#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" | ||
{{#invoke:string|rep|bla|glug|ignore_errors=true}} | ||||
{{#invoke:string|rep|àèò|3}} | àèòàèòàèò | àèòàèòàèò | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|uc|input string}} | INPUT STRING | INPUT STRING | ||
{{#invoke:string|uc|Województwo Łódzkie}} | WOJEWÓDZTWO ŁÓDZKIE | WOJEWÓDZTWO ŁÓDZKIE | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|len| foo }} | 5 | 5 | ||
{{#invoke:string|len|s= foo }} | 3 | 3 | ||
{{#invoke:string|len}} | 0 | 0 | ||
{{#invoke:string|len|s=}} | 0 | 0 | ||
{{#invoke:string|len| }} | 3 | 3 | ||
{{#invoke:string|len|最近の更新}} | 5 | 5 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|count|aabbcc|a}} | 2 | 2 | ||
{{#invoke:string|count|aabbcc|[ac]|plain=false}} | 4 | 4 | ||
{{#invoke:string|count|aaabaaac|[^a]|plain=false}} | 2 | 2 | ||
{{#invoke:string|count|aaabaaac|^a|plain=false}} | 1 | 1 | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:string|pos|abcdefghi | 4 }} | d | d | ||
{{#invoke:string|pos|target = abcdefghi |pos = 4}} | d | d | ||