Jump to content

Module talk:Ustring/testcases

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GKFX (talk | contribs) at 11:22, 14 November 2021 (run tests). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

2 of 10 tests failed.

test_gsub

test_gsub
Text Expected Actual
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
Text Expected Actual
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
Text Expected Actual
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