Difference between revisions of "Module:Redirect/testcases"
Jump to navigation
Jump to search
test>Darklama (4th test might need span to match) |
test>Darklama (+4 testcases) |
||
| Line 7: | Line 7: | ||
self:preprocess_equals('{{#invoke:Redirect|main| }}', '') | self:preprocess_equals('{{#invoke:Redirect|main| }}', '') | ||
self:preprocess_equals('{{#invoke:Redirect|main|File talk:twenty-seven species of furry marmot grooving in a Vandal}}', '<span style="text-color:red;">[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]]</span>') | self:preprocess_equals('{{#invoke:Redirect|main|File talk:twenty-seven species of furry marmot grooving in a Vandal}}', '<span style="text-color:red;">[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]]</span>') | ||
| − | self:preprocess_equals('{{#invoke: | + | self:preprocess_equals('{{#invoke:Redirect|main|[[WP:AFC]]|bracket=yes}}','[[Wikipedia:Articles for creation]]') |
| + | self:preprocess_equals('{{#invoke:Redirect|main|[[WP:AFC]]}}', 'Wikipedia:Articles for creation') | ||
| + | self:preprocess_equals('{{#invoke:Redirect|main| [[WP:AFC]] }}', 'Wikipedia:Articles for creation') | ||
| + | self:preprocess_equals('{{#invoke:Redirect|main|WP:AFC|bracket=yes}}', '[[Wikipedia:Articles for creation]]') | ||
| + | self:preprocess_equals('{{#invoke:Redirect|main| WP:AFC |bracket=yes}}', '[[Wikipedia:Articles for creation]]') | ||
end | end | ||
return p | return p | ||
Revision as of 22:03, 31 March 2013
Documentation for this module may be created at Module:Redirect/testcases/doc
-- Unit tests for [[Module:Redirect]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_main()
self:preprocess_equals('{{#invoke:Redirect|main|WP:AFC}}', 'Wikipedia:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect|main| WP:AFC }}', 'Wikipedia:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect|main| }}', '')
self:preprocess_equals('{{#invoke:Redirect|main|File talk:twenty-seven species of furry marmot grooving in a Vandal}}', '<span style="text-color:red;">[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]]</span>')
self:preprocess_equals('{{#invoke:Redirect|main|[[WP:AFC]]|bracket=yes}}','[[Wikipedia:Articles for creation]]')
self:preprocess_equals('{{#invoke:Redirect|main|[[WP:AFC]]}}', 'Wikipedia:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect|main| [[WP:AFC]] }}', 'Wikipedia:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect|main|WP:AFC|bracket=yes}}', '[[Wikipedia:Articles for creation]]')
self:preprocess_equals('{{#invoke:Redirect|main| WP:AFC |bracket=yes}}', '[[Wikipedia:Articles for creation]]')
end
return p