Jump to content

Module:Delink/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Martijn Hoekstra (talk | contribs) at 19:39, 2 April 2013 (attempt at utest). 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)
local p = require('Module:UnitTests')
local delink = require('Module:User:Mr. Stradivarius/sandbox2')

local function test(name, text_in, expected)
    p:equals_deep(name, CSV._delink(text_in), expected, {nowiki = true})
end

function p:test_all()
    test('Bare wikilink', '[[Apple]]', nil, 'Apple')
end


return p