Difference between revisions of "Module:Delink/testcases"
Jump to navigation
Jump to search
blackwiki>Mr. Stradivarius m (Mr. Stradivarius moved page Module:User:Mr. Stradivarius/sandbox2/testcases to Module:Delink/testcases without leaving a redirect: moving in line with module page) |
blackwiki>Mr. Stradivarius (update module name) |
||
| Line 2: | Line 2: | ||
function p:test_all() | function p:test_all() | ||
| − | self:preprocess_equals('{{#invoke: | + | self:preprocess_equals('{{#invoke:Delink|delink|[[Apple]]}}', 'Apple') |
| − | self:preprocess_equals('{{#invoke: | + | self:preprocess_equals('{{#invoke:Delink|delink|[[Orange]]s are dissimilar to [[Apple]]s}}', 'Oranges are dissimilar to Apples') |
| − | self:preprocess_equals('{{#invoke: | + | 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: | + | self:preprocess_equals('{{#invoke:Delink|delink|All [[Gone]] [[wikt:to|]] [[Bed]] [[Now]]}}', 'All Gone to Bed Now') |
| − | self:preprocess_equals('{{#invoke: | + | self:preprocess_equals('{{#invoke:Delink|delink|[[Survey]] of [http://books.google.com Google Books] on [[UK|Britain]]}}', 'Survey of Google Books on Britain') |
end | end | ||
return p | return p | ||
Revision as of 08:49, 3 April 2013
Documentation for this module may be created at Module:Delink/testcases/doc
local p = require('Module:UnitTests')
function p:test_all()
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
return p