GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — Module:Example/testcases - Wikipedia

< Module:Example
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')
    self:preprocess_equals('{{#invoke:Example|count_fruit|bananas=Not a number|apples=Not a number}}', 'I have 0 bananas and 0 apples')
    self:preprocess_equals('{{#invoke:Example|count_fruit}}', 'I have 0 bananas and 0 apples')

end

function p:test_Name2()
    self:preprocess_equals('{{#invoke:Example|Name2}}', 'Lonely')
    self:preprocess_equals('{{#invoke:Example|Name2|1}}', 'Lonely')
    self:preprocess_equals('{{#invoke:Example|Name2|1|2}}', 'Be positive!')
    self:preprocess_equals('{{#invoke:Example|Name2|2|1}}', '1')
end

return p
Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Example/testcases&oldid=1277960011"
Category:
  • Module test cases
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.