Module:Links/testcases

-- Unit tests. Click talk page to run tests. local mLinks =require("Dev:Links") local p ={ main={ -- function name options={nowiki=true}, tests = { preprocess_equals_many ={ {'www.google.com', '[//www.google.com]'}, {'g', 'g'}, {'wwwgoogle.com', 'wwwgoogle.com'}, {'Module:links|links', 'links'}, {'http://dev.wikia.com|dev','dev'}, {'jumbles','jumbles'}, {,},               {'www.purple.com|type=local','www.purple.com'}, {'purple.com|purple|type=ext','[//purple.com purple]'}, {'z|type=ext',''}, {'tornadocom|type=ext',''}, {'Category:Browse','Category:Browse'}, {'category:Browse','category:Browse'}, {'Ω.|type=ext',''}, {'www.wikia.com/위키백과:대문','[//www.wikia.com/위키백과:대문]'}, },       },    },    link = { options={nowiki=true}, tests = { equals= { {'link with label',mLinks.link('http://dev.wikia.com','dev'),'dev',{nowiki=true}}, {'ext link', mLinks.link('http://dev.wikia.com'),''}, {'local link with label',mLinks.link('g','test'), 'g|test',{nowiki=true}}, {'category link',mLinks.link('Category:Browse'),'Category:Browse'}, {'external link with ext param',mLinks.link('purple.com','purple',"ext"),'[//purple.com purple]'}, },       }    } }

return p