Difference between revisions of "Module:Delink/testcases"
Jump to navigation
Jump to search
blackwiki>Mr. Stradivarius (update module name) |
blackwiki>Mr. Stradivarius (add more pipe trick tests) |
||
| Line 1: | Line 1: | ||
local p = require('Module:UnitTests') | local p = require('Module:UnitTests') | ||
| − | function p: | + | function p:test_basic() |
self:preprocess_equals('{{#invoke:Delink|delink|[[Apple]]}}', 'Apple') | self:preprocess_equals('{{#invoke:Delink|delink|[[Apple]]}}', 'Apple') | ||
self:preprocess_equals('{{#invoke:Delink|delink|[[Orange]]s are dissimilar to [[Apple]]s}}', 'Oranges are dissimilar to Apples') | self:preprocess_equals('{{#invoke:Delink|delink|[[Orange]]s are dissimilar to [[Apple]]s}}', 'Oranges are dissimilar to Apples') | ||
| Line 7: | Line 7: | ||
self:preprocess_equals('{{#invoke:Delink|delink|All [[Gone]] [[wikt:to|]] [[Bed]] [[Now]]}}', 'All Gone to Bed Now') | self:preprocess_equals('{{#invoke:Delink|delink|All [[Gone]] [[wikt:to|]] [[Bed]] [[Now]]}}', 'All Gone to Bed Now') | ||
self:preprocess_equals('{{#invoke:Delink|delink|[[Survey]] of [http://books.google.com Google Books] on [[UK|Britain]]}}', 'Survey of Google Books on Britain') | self:preprocess_equals('{{#invoke:Delink|delink|[[Survey]] of [http://books.google.com Google Books] on [[UK|Britain]]}}', 'Survey of Google Books on Britain') | ||
| + | end | ||
| + | |||
| + | function p:test_pipetrick() | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Pipe (computing)|]]}}', 'Pipe') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Boston, Massachusetts|]]}}', 'Boston') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Wikipedia:Verifiability|]]}}', 'Verifiability') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[User:Example|]]}}', 'Example') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Template:Welcome|]]}}', 'Welcome') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Yours, Mine and Ours (1968 film)|]]}}', 'Yours, Mine and Ours') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[:es:Wikipedia:Políticas|]]}}', 'Wikipedia:Políticas') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Il Buono, il Brutto, il Cattivo|]]}}', 'Il Buono') | ||
| + | self:preprocess_equals('{{#invoke:Delink|delink|[[Wikipedia:Manual of Style (Persian)|]]}}', 'Manual of Style') | ||
end | end | ||
return p | return p | ||
Revision as of 09:00, 3 April 2013
Documentation for this module may be created at Module:Delink/testcases/doc
local p = require('Module:UnitTests')
function p:test_basic()
self:preprocess_equals('{{#invoke:Delink|delink|[[Apple]]}}', 'Apple')
self:preprocess_equals('{{#invoke:Delink|delink|[[Orange]]s are dissimilar to [[Apple]]s}}', 'Oranges are dissimilar to Apples')
self:preprocess_equals('{{#invoke:Delink|delink|[[Apple]]s and [[orange]]s and [[fruit salad|other kinds of fruit]]}}', 'Apples and oranges and other kinds of fruit')
self:preprocess_equals('{{#invoke:Delink|delink|All [[Gone]] [[wikt:to|]] [[Bed]] [[Now]]}}', 'All Gone to Bed Now')
self:preprocess_equals('{{#invoke:Delink|delink|[[Survey]] of [http://books.google.com Google Books] on [[UK|Britain]]}}', 'Survey of Google Books on Britain')
end
function p:test_pipetrick()
self:preprocess_equals('{{#invoke:Delink|delink|[[Pipe (computing)|]]}}', 'Pipe')
self:preprocess_equals('{{#invoke:Delink|delink|[[Boston, Massachusetts|]]}}', 'Boston')
self:preprocess_equals('{{#invoke:Delink|delink|[[Wikipedia:Verifiability|]]}}', 'Verifiability')
self:preprocess_equals('{{#invoke:Delink|delink|[[User:Example|]]}}', 'Example')
self:preprocess_equals('{{#invoke:Delink|delink|[[Template:Welcome|]]}}', 'Welcome')
self:preprocess_equals('{{#invoke:Delink|delink|[[Yours, Mine and Ours (1968 film)|]]}}', 'Yours, Mine and Ours')
self:preprocess_equals('{{#invoke:Delink|delink|[[:es:Wikipedia:Políticas|]]}}', 'Wikipedia:Políticas')
self:preprocess_equals('{{#invoke:Delink|delink|[[Il Buono, il Brutto, il Cattivo|]]}}', 'Il Buono')
self:preprocess_equals('{{#invoke:Delink|delink|[[Wikipedia:Manual of Style (Persian)|]]}}', 'Manual of Style')
end
return p