Module:Hello, world!/testcases

-- Unit tests for Module:Hello, world!. Click talk page to run tests. local p = require('Module:UnitTests') function p:test_hello_world self:preprocess_equals('', 'Hello, world!') end function p:test_hello self:preprocess_equals('', 'Hello, Fred!') end function p:test_add self:preprocess_equals('', '8') end function p:test_count_fruit self:preprocess_equals('', 'I have 5 bananas and 3 apples') end

function p:test_has_fruit self:preprocess_equals('', 'Fred has: 5 bananas 7 cherries') end function p:test_custom_fruit self:preprocess_equals('', 'I have: 5 kiwis 10 pineapples') end function p:test_custom_fruit_2 self:preprocess_equals('', 'Fred has: 5 kiwis 10 pineapples') end

function p:test_hello_world_extraneous self:preprocess_equals('', 'Hello, world!') end function p:test_hello_noone self:preprocess_equals('', 'Hello, !') end function p:test_add_backwards self:preprocess_equals('', '8') end function p:test_count_fruit_otherorder self:preprocess_equals('', 'I have 5 bananas and 3 apples') end

function p:test_has_fruit_alternateorder self:preprocess_equals('', 'Fred has: 5 bananas 7 cherries') end function p:test_custom_fruit_otherorder self:preprocess_equals('', 'I have: 10 pineapples 5 kiwis') end function p:test_custom_fruit_2_alternateorder self:preprocess_equals('', 'Fred has: 10 pineapples 5 kiwis') end

return p