View source for Module:String/testcases
Appearance
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
-- Unit tests for [[Module:String]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_len()
self:preprocess_equals_many('{{#invoke:String|len|', '}}', {
{' foo ', '5'},
{'s= foo ', '3'},
{'', '0'},
{'s=', '0'},
{' ', '3'},
{'最近の更新', '5'},
})
end
function p:test_replace()
self:preprocess_equals_many('{{#invoke:String|replace|', '}}', {
{'1.1.1.1|.|/', '1/1/1/1'},
{'alpha (beta)| (| gamma (', 'alpha gamma (beta)'},
{'Dog (cat)|%s%(.*%)||plain=false', 'Dog'},
})
end
000
1:0
Template used on this page:
Return to Module:String/testcases.