Difference between revisions of "Module:Redirect/testcases"

From blackwiki
Jump to navigation Jump to search
test>Wnt
(Trying a bracket test)
test>Wnt
(seems my attention is straying...)
Line 8: Line 8:
 
     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}}', '[[Module:redirect]] error: File not found (id=0): - [[File talk:twenty-seven species of furry marmot grooving in a Vandal]]')
 
     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]]')
     self:preprocess_equals('{{#invoke:redirect|main|WP:AFC|bracket=yes}}','[[WP:AFC]]')
+
     self:preprocess_equals('{{#invoke:redirect|main|[[WP:AFC]]|bracket=yes}}','[[Wikipedia:Articles for Creation]]')
 
end
 
end
 
return p
 
return p

Revision as of 16:39, 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('{{#invoke:Redirect|main|    }}', '')
    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]]')
    self:preprocess_equals('{{#invoke:redirect|main|[[WP:AFC]]|bracket=yes}}','[[Wikipedia:Articles for Creation]]')
end
return p