Jump to content

Module:Redirect/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 10:48, 24 July 2013 (test the sandbox). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- 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/sandbox|main|WP:AFC}}', 'Wikipedia:Articles for creation')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|  WP:AFC  }}', 'Wikipedia:Articles for creation')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|    }}', '')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|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/sandbox|main|[[WP:AFC]]|bracket=yes}}','[[Wikipedia:Articles for creation]]')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|[[WP:AFC]]}}', 'Wikipedia:Articles for creation')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|  [[WP:AFC]]  }}', 'Wikipedia:Articles for creation')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|WP:AFC|bracket=yes}}', '[[Wikipedia:Articles for creation]]')
    self:preprocess_equals('{{#invoke:Redirect/sandbox|main|  WP:AFC  |bracket=yes}}', '[[Wikipedia:Articles for creation]]')
end
return p