Jump to content

Module talk:String2/testcases

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

3 of 34 tests failed.

test_getError

test_getError
Test Live Sandbox Expected
checkY {{#invoke:String2|getError|123}}
checkY {{#invoke:String2|getError|error}}
checkY {{#invoke:String2|getError|Expression error}}
☒N {{#invoke:String2|getError|text<strong class="error">Expression error: Unrecognized word &quot;california&quot;.</strong>text}} <strong class="error"><span class="scribunto-error mw-scribunto-error-8d86ebaa">Lua error in Module:String2 at line 420: attempt to index local &#039;text&#039; (a nil value).</span></strong> <strong class="error"><span class="scribunto-error mw-scribunto-error-a4401ad1">Lua error in Module:String2/sandbox at line 420: attempt to index local &#039;text&#039; (a nil value).</span></strong> <strong class="error">Expression error: Unrecognized word &quot;california&quot;.</strong>

test_isInteger

test_isInteger
Test Live Sandbox Expected
checkY {{#invoke:String2|isInteger|1993}} true true true
checkY {{#invoke:String2|isInteger|1993|02|24|08|30}} true true true
checkY {{#invoke:String2|isInteger|1993|02||08|30|empty=yes}} true true true
checkY {{#invoke:String2|isInteger|1993|02| |08|30|empty=yes}} true true true
checkY {{#invoke:String2|isInteger|}} false false false
checkY {{#invoke:String2|isInteger|1993|02||08|30}} false false false

test_matchAny

test_matchAny
Test Live Sandbox Expected
checkY {{#invoke:String2|matchAny|123|abc|source=adc 123}} 1 1 1
checkY {{#invoke:String2|matchAny|123|abc|source=adc 124}}
checkY {{#invoke:String2|matchAny|123|abc|source=abc 124}} 2 2 2

test_sentence

test_sentence
Test Live Sandbox Expected
checkY {{#invoke:String2|sentence|*teSt}}
  • Test
  • Test
  • Test
checkY {{#invoke:String2|sentence|[[tEst]]}} Test Test Test
checkY {{#invoke:String2|sentence|[[test|pipeTest]]}} Pipetest Pipetest Pipetest
checkY {{#invoke:String2|sentence|32ND}} 32nd 32nd 32nd
checkY {{#invoke:String2|sentence|3 &times;}} 3 × 3 × 3 ×
checkY {{#invoke:String2|sentence|<li>TEST</li>}}
  • Test
  • Test
  • Test
  • checkY {{#invoke:String2|sentence|1900 &ndash; 2000}} 1900 – 2000 1900 – 2000 1900 – 2000
    checkY {{#invoke:String2|sentence|éclair}} Éclair Éclair Éclair
    checkY {{#invoke:String2|sentence|Äpfel}} Äpfel Äpfel Äpfel
    ☒N {{#invoke:String2|sentence|teXT <nowiki>TeXT</nowiki>}} Text TeXT Text TeXT Text TeXT

    test_ucfirst

    test_ucfirst
    Test Live Sandbox Expected
    checkY {{#invoke:String2|ucfirst|*test}}
    • Test
    • Test
    • Test
    checkY {{#invoke:String2|ucfirst|[[test]]}} Test Test Test
    checkY {{#invoke:String2|ucfirst|[[test|pipetest]]}} Pipetest Pipetest Pipetest
    checkY {{#invoke:String2|ucfirst|32nd}} 32nd 32nd 32nd
    checkY {{#invoke:String2|ucfirst|3 &times;}} 3 × 3 × 3 ×
    checkY {{#invoke:String2|ucfirst|<li>test</li>}}
  • Test
  • Test
  • Test
  • checkY {{#invoke:String2|ucfirst|1900 &ndash; 2000}} 1900 – 2000 1900 – 2000 1900 – 2000
    checkY {{#invoke:String2|ucfirst|éclair}} Éclair Éclair Éclair
    checkY {{#invoke:String2|ucfirst|äpfel}} Äpfel Äpfel Äpfel
    checkY {{#invoke:String2|ucfirst|[[endocrinology]], [[infectious disease (medical specialty)|infectious disease]]}} Endocrinology, infectious disease Endocrinology, infectious disease Endocrinology, infectious disease
    ☒N {{#invoke:String2|ucfirst|[//example.com ext link test]}} Ext link test Ext link test ext link test