Module:Example/testcases: Difference between revisions
Appearance
Content deleted Content added
hello_to testcase |
QuickQuokka (talk | contribs) No edit summary |
||
Line 12: | Line 12: | ||
function p:test_count_fruit() |
function p:test_count_fruit() |
||
self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=5|apples=3}}', 'I have 5 bananas and 3 apples') |
self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=5|apples=3}}', 'I have 5 bananas and 3 apples') |
||
self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=1|apples=1}}', 'I have 1 banana and 1 apple') |
|||
end |
end |
||
return p |
return p |
Revision as of 03:28, 29 August 2023
![]() | This is the test cases page for the module Module:Example. Results of the test cases. |
-- 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_to|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')
self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=1|apples=1}}', 'I have 1 banana and 1 apple')
end
return p