Difference between revisions of "Module:Redirect/testcases"

From blackwiki
Jump to navigation Jump to search
test>Wnt
(Odd... how does it get the module name then?)
test>Wnt
(So much for cutting and pasting.)
Line 3: Line 3:
 
   
 
   
 
function p:test_main()
 
function p:test_main()
     self:preprocess_equals_many('{{#invoke:Redirect|WP:AFC', 'Wikipedia:Articles for creation', {
+
     self:preprocess_equals('{{#invoke:Redirect|main|WP:AFC}}', 'Wikipedia:Articles for creation')
        {' WP:AFC ', 'Wikipedia:Articles for creation'},
+
 
        {' ', ''},
+
    self:preprocess_equals('{{#invoke:Redirect|main|  WP:AFC }}', 'Wikipedia:Articles for creation')
        {'File talk:twenty-seven species of furry marmot grooving in a Vandal', '[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]'},
+
    self:preprocess_equals(' ', '')
    })
+
    self:preprocess_equals('{{#invoke:Redirect|main|File talk:twenty-seven species of furry marmot grooving in a Vandal}}', '[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]')
  
 
end
 
end
 
return p
 
return p

Revision as of 15:53, 18 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(' ', '')
    self:preprocess_equals('{{#invoke:Redirect|main|File talk:twenty-seven species of furry marmot grooving in a Vandal}}', '[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]')

end
return p