Jump to content

Module:Example/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Blanked the page
Tags: Blanking Mobile edit Mobile web edit
m Reverted edits by 2001:44C8:45C4:6836:1:0:CB99:7979 (talk) to last version by Pppery
Line 1: Line 1:
-- Unit tests for [[Module:Example]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_hello()
self:preprocess_equals('{{#invoke:Example | hello}}', 'Hello World!')
end

function p:test_hello_to()
self:preprocess_equals('{{#invoke:Example|hello|Fred}}', 'Hello, Fred!')
end

function p:test_count_fruit()
self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=5|apples=3}}', 'I have 5 bananas and 3 apples')
end
return p

Revision as of 09:36, 14 April 2020

-- Unit tests for [[Module:Example]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_hello()
    self:preprocess_equals('{{#invoke:Example | hello}}', 'Hello World!')
end

function p:test_hello_to()
    self:preprocess_equals('{{#invoke:Example|hello|Fred}}', 'Hello, Fred!')
end

function p:test_count_fruit()
    self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=5|apples=3}}', 'I have 5 bananas and 3 apples')
end
return p