Jump to content

Module talk:Ustring/testcases

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by GKFX (talk | contribs) at 11:33, 14 November 2021 (Display sandbox). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

2 of 10 tests failed.

test_gsub

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_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_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