모듈:BananasArgs/시험장

위키백과, 우리 모두의 백과사전.
-- [[모듈:BananaArgs]]의 유닛 테스트입니다. 테스트를 실행하려면 토론 문서를 클릭하세요.
local p = require('Module:UnitTests')
 
function p:test_hello_world()
    self:preprocess_equals('{{#invoke:BananasArgs|hello_world}}', 'Hello, world!')
end
 
function p:test_hello()
    self:preprocess_equals('{{#invoke:BananasArgs|hello|민준}}', '안녕하세요, 민준님!')
end
 
function p:test_add()
    self:preprocess_equals('{{#invoke:BananasArgs|add|5|3}}', '8')
end
 
function p:test_count_fruit()
    self:preprocess_equals('{{#invoke:BananasArgs|count_fruit|바나나=5|사과=3}}', '저는 바나나 5개와 사과 3개를 가지고 있습니다.')
end

function p:test_has_fruit()
    self:preprocess_equals('{{#invoke:BananasArgs|has_fruit|민준|바나나=5|체리=7}}', '민준님은 바나나 5개 체리 7개를 가지고 있습니다.')
end
 
function p:test_custom_fruit()
    self:preprocess_equals('{{#invoke:BananasArgs|custom_fruit|파인애플=10|키위=5}}', '저는 파인애플 10개 키위 5개를 가지고 있습니다.')
end
 
function p:test_custom_fruit_2()
    self:preprocess_equals('{{#invoke:BananasArgs|custom_fruit_2|민준|파인애플=10|키위=5}}', '민준님은 파인애플 10개 키위 5개를 가지고 있습니다.')
end

function p:test_hello_world_extraneous()
    self:preprocess_equals('{{#invoke:BananasArgs|hello_world|extra}}', 'Hello, world!')
end
 
function p:test_hello_noone()
    self:preprocess_equals('{{#invoke:BananasArgs|hello|}}', '안녕하세요, 님!')
end
 
function p:test_add_backwards()
    self:preprocess_equals('{{#invoke:BananasArgs|add|2=5|1=3}}', '8')
end
 
function p:test_count_fruit_otherorder()
    self:preprocess_equals('{{#invoke:BananasArgs|count_fruit|사과=3|바나나=5}}', '저는 바나나 5개와 사과 3개를 가지고 있습니다.')
end

function p:test_has_fruit_alternateorder()
    self:preprocess_equals('{{#invoke:BananasArgs|has_fruit|체리=7|1=민준|바나나=5}}', '민준님은 바나나 5개 체리 7개를 가지고 있습니다.')
end
 
function p:test_custom_fruit_otherorder()
    self:preprocess_equals('{{#invoke:BananasArgs|custom_fruit|키위=5|파인애플=10}}', '저는 키위 5개 파인애플 10개를 가지고 있습니다.')
end
 
function p:test_custom_fruit_2_alternateorder()
    self:preprocess_equals('{{#invoke:BananasArgs|custom_fruit_2|키위=5|1=민준|파인애플=10}}', '민준님은 키위 5개 파인애플 10개를 가지고 있습니다.')
end

return p