Jump to content

Module:String/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dcoetzee (talk | contribs) at 08:01, 25 February 2013 (function p:test_replace() self:preprocess_equals('{{#invoke:String|replace|1.1.1.1|.|/}}', '1/1/1/1') end). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:String]]. Click talk page to run tests.
local p = require('Module:UnitTests')
 
function p:test_len()
    self:preprocess_equals('{{#invoke:String|len| foo |}}', '5')
    self:preprocess_equals('{{#invoke:String|len|s= foo |}}', '3')
end

function p:test_replace()
    self:preprocess_equals('{{#invoke:String|replace|1.1.1.1|.|/}}', '1/1/1/1')
end

return p