Module:PageLinks/testcases
Appearance
| This is the test cases page for the module Module:PageLinks. Results of the test cases. |
local p = require('Module:UnitTests')
function p:test_basic()
self:preprocess_equals('{{#invoke:PageLinks | main | t | page=Example }}', '<span>[[:Example|Example]] <span class="plainlinks lx">([[Talk:Example|talk]])</span></span>')
end
function p:test_category()
self:preprocess_equals('{{#invoke:PageLinks | main | t | page=Category:Example }}', '<span>[[:Category:Example|Category:Example]] <span class="plainlinks lx">([[Category talk:Example|talk]])</span></span>')
end
function p:test_talk()
self:preprocess_equals('{{#invoke:PageLinks | single | t | page=Example }}', '[[Talk:Example|talk]]')
end
function p:test_views()
self:preprocess_equals('{{#invoke:PageLinks | single | vlm-sgs | page=Example }}', '[https://pageviews.toolforge.org/?start=2025-09-22&end=2025-11-21&project=en.wikipedia.org&pages=Example stats]')
end
function p:test_logs()
self:preprocess_equals('{{#invoke:PageLinks | single | tl | page=Sylven Landesberg }}', '[//en.wikipedia.org/w/index.php?title=Special%3ALog&page=Sylven+Landesberg logs]')
end
return p