Discuție Modul:StringUtils/testcases
All tests passed.
test_appendIfMissing:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|appendIfMissing|aliale|le}} | aliale | aliale | |
{{#invoke:StringUtils|appendIfMissing|nio|le}} | niole | niole |
test_appendToString:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|appendToString|George|Coșbuc}} | GeorgeCoșbuc | GeorgeCoșbuc | |
{{#invoke:StringUtils|appendToString||Coșbuc}} |
test_capitalize:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|capitalize|aliale}} | Aliale | Aliale | |
{{#invoke:StringUtils|capitalize|Alio}} | Alio | Alio | |
{{#invoke:StringUtils|capitalize|ALIO}} | ALIO | ALIO |
test_defaultString:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|defaultString|George|Coșbuc}} | George | George | |
{{#invoke:StringUtils|defaultString||Coșbuc}} | Coșbuc | Coșbuc |
test_encloseString:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|encloseString|Gigi|(}} | (Gigi | (Gigi | |
{{#invoke:StringUtils|encloseString||(|)}} | |||
{{#invoke:StringUtils|encloseString|Gigi|(|)}} | (Gigi) | (Gigi) | |
{{#invoke:StringUtils|encloseString|Gigi||)}} | Gigi) | Gigi) |
test_endsWith:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|endsWith|noc|oc}} | true | true | |
{{#invoke:StringUtils|endsWith|noc|noc}} | true | true | |
{{#invoke:StringUtils|endsWith|noc|unoc}} | false | false | |
{{#invoke:StringUtils|endsWith|noc|mi}} | false | false | |
{{#invoke:StringUtils|endsWith|noc|}} | false | false |
test_firstValue:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|firstValue|Gigi|Bobo}} | Gigi | Gigi | |
{{#invoke:StringUtils|firstValue|||Gigi|Bobo}} | Gigi | Gigi | |
{{#invoke:StringUtils|firstValue}} | |||
{{#invoke:StringUtils|firstValue|||}} |
test_prependIfMissing:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|prependIfMissing|Q123|Q}} | Q123 | Q123 | |
{{#invoke:StringUtils|prependIfMissing|123|Q}} | Q123 | Q123 |
test_prependToString:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|prependToString|Coșbuc|George}} | GeorgeCoșbuc | GeorgeCoșbuc | |
{{#invoke:StringUtils|prependToString||George}} |
test_removeEnd:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|removeEnd|noc|cu}} | noc | noc | |
{{#invoke:StringUtils|removeEnd|minc|nc}} | mi | mi | |
{{#invoke:StringUtils|removeEnd|min|min}} | |||
{{#invoke:StringUtils|removeEnd|min|omin}} | min | min | |
{{#invoke:StringUtils|removeEnd|noc|cu|oc}} | n | n |
test_removeStart:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|removeStart|noc|cu}} | noc | noc | |
{{#invoke:StringUtils|removeStart|minc|mi}} | nc | nc | |
{{#invoke:StringUtils|removeStart|min|min}} | |||
{{#invoke:StringUtils|removeStart|min|mino}} | min | min | |
{{#invoke:StringUtils|removeStart||gig}} | |||
{{#invoke:StringUtils|removeStart|noc|cu|n}} | oc | oc |
test_startsWith:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|startsWith|noc|no}} | true | true | |
{{#invoke:StringUtils|startsWith|noc|noc}} | true | true | |
{{#invoke:StringUtils|startsWith|noc|nocu}} | false | false | |
{{#invoke:StringUtils|startsWith|noc|mi}} | false | false | |
{{#invoke:StringUtils|startsWith|noc|}} | false | false |
test_stripNamespace:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|stripNamespace|Fișier:Groundzero.jpg}} | Groundzero.jpg | Groundzero.jpg | |
{{#invoke:StringUtils|stripNamespace|Groundzero.jpg}} | Groundzero.jpg | Groundzero.jpg |
test_substringAfter:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|substringAfter|moromete|m}} | oromete | oromete | |
{{#invoke:StringUtils|substringAfter|Fișier:Groundzero.jpg|:}} | Groundzero.jpg | Groundzero.jpg |
test_substringBefore:
Text | Așteptat | Rezultat | |
---|---|---|---|
{{#invoke:StringUtils|substringBefore|[[Fișier:Groundzero.jpg]]|]]}} | [[Fișier:Groundzero.jpg | [[Fișier:Groundzero.jpg | |
{{#invoke:StringUtils|substringBefore|moromete|e}} | morom | morom |