Jump to content

Module:Redirect/sandbox/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wnt (talk | contribs) at 18:54, 21 November 2013 (Removing testcase expecting a Module:redirect error. It appears this text has been completely removed from the module intentionally.). 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|[[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