Jump to content

Module:String2/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GKFX (talk | contribs) at 15:13, 9 April 2021 (Create testcases). 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)
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')

-- Example unit test.
function p:test_matchAny()
	self:preprocess_equals('{{#invoke:Example|matchAny|123|abc|source=adc 123}}', '1')
	self:preprocess_equals('{{#invoke:Example|matchAny|123|abc|source=adc 124}}', '')
	self:preprocess_equals('{{#invoke:Example|matchAny|123|abc|source=abc 124}}', '2')
	self:preprocess_equals('{{#invoke:Example|matchAny|12[3-6]|a[b-e]c|source=adc 129|plain=false}}', '2')
end

return p