Module:Redirect/sandbox/testcases
< Module:Redirect | sandbox
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Redirect/sandbox/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/sandbox|main|SW:AFC}}', 'Stiles.casa Wiki:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main| SW:AFC }}', 'Stiles.casa Wiki:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main| }}', '')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main|[[SW:AFC]]|bracket=yes}}','[[Stiles.casa Wiki:Articles for creation]]')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main|[[SW:AFC]]}}', 'Stiles.casa Wiki:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main| [[SW:AFC]] }}', 'Stiles.casa Wiki:Articles for creation')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main|SW:AFC|bracket=yes}}', '[[Stiles.casa Wiki:Articles for creation]]')
self:preprocess_equals('{{#invoke:Redirect/sandbox|main| SW:AFC |bracket=yes}}', '[[Stiles.casa Wiki:Articles for creation]]')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block|text=[[SW:AFC]] [[SW:AFD]]|nowiki=no}}', '[[Stiles.casa Wiki:Articles for creation]] [[Stiles.casa Wiki:Articles for deletion]]')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block|text=[[SW:AFC]] [[SW:AFD]]}}', '<pre><nowiki>[[Stiles.casa Wiki:Articles for creation]] [[Stiles.casa Wiki:Articles for deletion]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block|Module talk:Redirect/sandbox/data}}', '<pre><nowiki>== Standard ==\n[[Stiles.casa Wiki:Articles for creation]], [[Stiles.casa Wiki:Deletion review]], and [[Stiles.casa Wiki:Articles for deletion]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Alien (franchise)]]\n*[[CO]]\n*[[Percent sign]]\n\n== Fun with pipes ==\n[[Stiles.casa Wiki:Articles for deletion|spoil-funs]] [[wikt:test|test]]\n[[Space Cadet| Going nowhere ]]\n[[Vacuum packing| and redirected ]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block|Module talk:Redirect/sandbox/data|SW:AFD}}', '<pre><nowiki>== Standard ==\n[[SW:AFC]], [[ SW:DRV ]], and [[Stiles.casa Wiki:Articles for deletion]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Alien (franchise)]]\n*[[CO]]\n*[[Percent sign]]\n\n== Fun with pipes ==\n[[Stiles.casa Wiki:Articles for deletion|spoil-funs]] [[wikt:test|test]]\n[[Space Cadet| Going nowhere ]]\n[[Vacuum packing| and redirected ]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block| Module talk:Redirect/sandbox/data | SW:AFD }}', '<pre><nowiki>== Standard ==\n[[SW:AFC]], [[ SW:DRV ]], and [[Stiles.casa Wiki:Articles for deletion]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Alien (franchise)]]\n*[[CO]]\n*[[Percent sign]]\n\n== Fun with pipes ==\n[[Stiles.casa Wiki:Articles for deletion|spoil-funs]] [[wikt:test|test]]\n[[Space Cadet| Going nowhere ]]\n[[Vacuum packing| and redirected ]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block| Module talk:Redirect/sandbox/data | SW:AFD | pipe=yes}}', '<pre><nowiki>== Standard ==\n[[SW:AFC]], [[ SW:DRV ]], and [[SW:AFD]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Weyland-Yutani]]\n*[[Co.]]\n*[[%]]\n\n== Fun with pipes ==\n[[Stiles.casa Wiki:Articles for deletion|spoil-funs]] [[wikt:test|test]]\n[[Space Cadet| Going nowhere ]]\n[[Vacuum packing| and redirected ]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block| Module talk:Redirect/sandbox/data | SW:AFD | pipe = no }}', '<pre><nowiki>== Standard ==\n[[SW:AFC]], [[ SW:DRV ]], and [[Stiles.casa Wiki:Articles for deletion]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Alien (franchise)]]\n*[[CO]]\n*[[Percent sign]]\n\n== Fun with pipes ==\n[[SW:AFD|spoil-funs]] [[wikt:test|test]]\n[[ Space cadet | Going nowhere ]]\n[[ Vacuum packed | and redirected ]]</nowiki></pre>')
self:preprocess_equals('{{#invoke:Redirect/sandbox|block| Module talk:Redirect/sandbox/data | SW:AFD | pipe = make }}', '<pre><nowiki>== Standard ==\n[[SW:AFC]], [[ SW:DRV ]], and [[Stiles.casa Wiki:Articles for deletion|SW:AFD]]\n\n== Special characters that plague mw.ustring.gsub ==\n*[[Alien (franchise)|Weyland-Yutani]]\n*[[CO|Co.]]\n*[[Percent sign|%]]\n\n== Fun with pipes ==\n[[Stiles.casa Wiki:Articles for deletion|spoil-funs]] [[wikt:test|test]]\n[[Space Cadet| Going nowhere ]]\n[[Vacuum packing| and redirected ]]</nowiki></pre>')
end
return p