Jump to content

Module:String/testcases

विकिपीडिया से
imported>Dragons flight (obnoxious escaping case) के द्वारा 17:53, 25 फरवरी 2013 के बदलाव
-- 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')
    self:preprocess_equals('{{#invoke:String|replace|alpha (beta)| (| gamma (}}', 'alpha gamma (beta)')
end

return p