Module:ApplyLinkAnnotations/testcases
Appearance
![]() | This is the test cases page for the module Module:ApplyLinkAnnotations. Results of the test cases. |
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local m = require('Module:Sandbox/N8wilson/ApplyLinkAnnotations')
-- Example unit test.
function p:test_hello()
self:preprocess_equals('{{#invoke:Sandbox/N8wilson/ApplyLinkAnnotations|bySubstitutionInUnorderedList|hello}}', 'hello')
end
-- Test passing a link with no line breaks
function p:test_same_line()
self:preprocess_equals('{{#invoke:Sandbox/N8wilson/ApplyLinkAnnotations|bySubstitutionInUnorderedList|*[[hello]]}}', '*[[hello]]')
end
-- Test updating a single un-piped link in a list
function p:test_one_item_list()
local supply = [==[
*[[hello]]
]==]
local expect = [==[
*{{Annotated link |hello}}
]==]
self:equals(m.replaceLinksInUnorderedList(supply), expect)
end
return p