Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module talk:Ustring/testcases

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

2 of 10 live tests failed. All 10 sandbox tests passed. (refresh)

test_sub

test_sub
TestLiveSandboxExpected
checkYcheckY {{#invoke:ustring|sub| hello | 1 | 3}} he he he
checkYcheckY {{#invoke:ustring|sub| s1 = hello | 1 | 3}} hel hel hel
checkYcheckY {{#invoke:ustring|sub| s1 = hello | 0 | 3}} hel hel hel
checkYcheckY {{#invoke:ustring|sub| s1 = hello | -3 }} llo llo llo
checkYcheckY {{#invoke:ustring|sub| hello | -3 }} lo lo lo

test_onerror

test_onerror
TestLiveSandboxExpected
checkYcheckY {{#invoke:ustring|sub| hello | 1 | 3 | onerror = foo}} he he he
X markNcheckY {{#invoke:ustring|sub| s1 = hello | bar | 3 | onerror = foo}} Lua error: bad argument #2 to 'sub' (number expected, got string). foo foo
X markNcheckY {{#invoke:ustring|sub| s1 = hello | 0 | | onerror = foo}} Lua error: bad argument #3 to 'sub' (number expected, got string). foo foo

test_gsub

test_gsub
TestLiveSandboxExpected
checkYcheckY {{#invoke:ustring|gsub| hello world | world | x }} hello x hello x hello x
checkYcheckY {{#invoke:ustring|gsub| hello world| world | x }} hello world hello world hello world