Module talk:Ustring/testcases

2 of 10 tests failed.

test_gsub
Test Live Sandbox Expected
checkY {{#invoke:ustring|gsub| hello world | world | x }} hello x hello x hello x
checkY {{#invoke:ustring|gsub| hello world| world | x }} hello world hello world hello world
test_onerror
Test Live Sandbox Expected
checkY {{#invoke:ustring|sub| hello | 1 | 3 | onerror = foo}} he he he
☒N {{#invoke:ustring|sub| s1 = hello | bar | 3 | onerror = foo}} Lua error: bad argument #2 to 'sub' (number expected, got string). foo foo
☒N {{#invoke:ustring|sub| s1 = hello | 0 | | onerror = foo}} Lua error: bad argument #3 to 'sub' (number expected, got string). foo foo
test_sub
Test Live Sandbox Expected
checkY {{#invoke:ustring|sub| hello | 1 | 3}} he he he
checkY {{#invoke:ustring|sub| s1 = hello | 1 | 3}} hel hel hel
checkY {{#invoke:ustring|sub| s1 = hello | 0 | 3}} hel hel hel
checkY {{#invoke:ustring|sub| s1 = hello | -3 }} llo llo llo
checkY {{#invoke:ustring|sub| hello | -3 }} lo lo lo

Start a discussion about improving the Module:Ustring/testcases page

Start a discussion