Module:Yesno/testcases: Difference between revisions

From IDU Wiki
Jump to navigation Jump to search
en>DePiep
No edit summary
m 49 revisions imported
 
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
local p = require('Module:UnitTests')
local yesno = require('Module:Yesno')
local yesnoSandbox = require('Module:Yesno/sandbox')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()


function p:test_basic_arg1()
local function compareLiveAndSandbox(expected, liveValue, sandboxValue)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno}}', '{{Yesno}}')
local message = "Expected " .. tostring(expected) .. ". Got "
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|}}', '{{Yesno|}}')
suite:assertEquals(expected, liveValue, message .. tostring(liveValue)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| }}', '{{Yesno| }}')
.. " from live module.")
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|  }}', '{{Yesno|  }}')
suite:assertEquals(expected, sandboxValue, message .. tostring(sandboxValue)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=}}', '{{Yesno|1=}}')
.. " from sandbox.")
end
 
local function runYesnoTest(expected, inputValue)
local liveValue = yesno(inputValue)
local sandboxValue = yesnoSandbox(inputValue)
compareLiveAndSandbox(expected, liveValue, sandboxValue)
end
 
local function runYesnoTestWithDefault(expected, inputValue)
local liveValue = yesno(inputValue, 'default')
local sandboxValue = yesnoSandbox(inputValue, 'default')
compareLiveAndSandbox(expected, liveValue, sandboxValue)
end
 
--------------------------------------------------------------------------------
-- Basic tests
--------------------------------------------------------------------------------
 
function suite:testYes()
runYesnoTest(true, 'yes')
end
 
function suite:testY()
runYesnoTest(true, 'y')
end
 
function suite:testTrueText()
runYesnoTest(true, 'true')
end
 
function suite:testT()
runYesnoTest(true, 't')
end
 
function suite:testTrue()
runYesnoTest(true, true)
end
 
function suite:testOneText()
runYesnoTest(true, '1')
end
 
function suite:testOne()
runYesnoTest(true, 1)
end
 
function suite:testOn()
runYesnoTest(true, 'on')
end
 
function suite:testNo()
runYesnoTest(false, 'no')
end
 
function suite:testN()
runYesnoTest(false, 'n')
end
 
function suite:testF()
runYesnoTest(false, 'f')
end
 
function suite:testFalseText()
runYesnoTest(false, 'false')
end
 
function suite:testFalse()
runYesnoTest(false, false)
end
 
function suite:testZero()
runYesnoTest(false, 0)
end
 
function suite:testZeroText()
runYesnoTest(false, '0')
end
 
function suite:testOff()
runYesnoTest(false, 'off')
end
 
function suite:testNil()
runYesnoTest(nil, nil)
end
 
--------------------------------------------------------------------------------
-- Capitalisation tests
--------------------------------------------------------------------------------
 
function suite:testYesCaps()
runYesnoTest(true, 'Yes')
runYesnoTest(true, 'YES')
runYesnoTest(true, 'yEs')
end
 
function suite:testYCaps()
runYesnoTest(true, 'Y')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes}}', '{{Yesno|yes}}')
function suite:testTCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yeS}}', '{{Yesno|yeS}}')
runYesnoTest(true, 'T')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|YES}}', '{{Yesno|YES}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1}}', '{{Yesno|1}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=yes}}', '{{Yesno|1=yes}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|no}}', '{{Yesno|no}}')
function suite:testTrueTextCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|nO}}', '{{Yesno|nO}}')
runYesnoTest(true, 'True')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|0}}', '{{Yesno|0}}')
runYesnoTest(true, 'TRUE')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=no}}', '{{Yesno|1=no}}')
runYesnoTest(true, 'trUE')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|beans}}', '{{Yesno|beans}}')
function suite:testOnCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| beans }}', '{{Yesno| beans }}')
runYesnoTest(true, 'On')
runYesnoTest(true, 'ON')
runYesnoTest(true, 'oN')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|¬}}', '{{Yesno|¬}}')
function suite:testNoCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| ¬ }}', '{{Yesno| ¬ }}')
runYesnoTest(false, 'No')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1= ¬ }}', '{{Yesno|1= ¬ }}')
runYesnoTest(false, 'NO')
runYesnoTest(false, 'nO')
end
end


function p:test_set_yes()
function suite:testNCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes=aye|yes=aye}}', '{{Yesno|yes=aye}}')
runYesnoTest(false, 'N')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno||yes=aye}}', '{{Yesno||yes=aye}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| |yes=aye}}', '{{Yesno| |yes=aye}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|  |yes=aye}}', '{{Yesno|  |yes=aye}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=|yes=aye}}', '{{Yesno|1=|yes=aye}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes|yes=aye}}', '{{Yesno|yes|yes=aye}}')
function suite:testFCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yeS|yes=aye}}', '{{Yesno|yeS|yes=aye}}')
runYesnoTest(false, 'F')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|YES|yes=aye}}', '{{Yesno|YES|yes=aye}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1|yes=aye}}', '{{Yesno|1|yes=aye}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=yes|yes=aye}}', '{{Yesno|1=yes|yes=aye}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|no|yes=aye}}', '{{Yesno|no|yes=aye}}')
function suite:testFalseTextCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|nO|yes=aye}}', '{{Yesno|nO|yes=aye}}')
runYesnoTest(false, 'False')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|0|yes=aye}}', '{{Yesno|0|yes=aye}}')
runYesnoTest(false, 'FALSE')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=no|yes=aye}}', '{{Yesno|1=no|yes=aye}}')
runYesnoTest(false, 'fALSe')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|beans|yes=aye}}', '{{Yesno|beans|yes=aye}}')
function suite:testOffCaps()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| beans |yes=aye}}', '{{Yesno| beans |yes=aye}}')
runYesnoTest(false, 'ofF')
runYesnoTest(false, 'oFf')
runYesnoTest(false, 'oFF')
runYesnoTest(false, 'Off')
runYesnoTest(false, 'OfF')
runYesnoTest(false, 'OFf')
runYesnoTest(false, 'OFF')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|¬|yes=aye}}', '{{Yesno|¬|yes=aye}}')
--------------------------------------------------------------------------------
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| ¬ |yes=aye}}', '{{Yesno| ¬ |yes=aye}}')
-- Number conversion tests
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1= ¬ |yes=aye}}', '{{Yesno|1= ¬ |yes=aye}}')
--------------------------------------------------------------------------------


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=1|Yes=aye}}', '{{Yesno|1=1|Yes=aye}}')
function suite:testOneTextConversion()
runYesnoTest(true, '1.0')
runYesnoTest(true, '001')
end


function suite:testZeroTextConversion()
runYesnoTest(false, '0.0')
runYesnoTest(false, '000')
end
end


function p:test_set_no()
--------------------------------------------------------------------------------
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes=aye|no=nay}}', '{{Yesno|no=nay}}')
-- Test no default set
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno||no=nay}}', '{{Yesno||no=nay}}')
--------------------------------------------------------------------------------
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| |no=nay}}', '{{Yesno| |no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|  |no=nay}}', '{{Yesno|  |no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=|no=nay}}', '{{Yesno|1=|no=nay}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes|no=nay}}', '{{Yesno|yes|no=nay}}')
function suite:testStringNoDefault()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yeS|no=nay}}', '{{Yesno|yeS|no=nay}}')
runYesnoTest(nil, 'foo')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|YES|no=nay}}', '{{Yesno|YES|no=nay}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1|no=nay}}', '{{Yesno|1|no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=yes|no=nay}}', '{{Yesno|1=yes|no=nay}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|no|no=nay}}', '{{Yesno|no|no=nay}}')
function suite:testNumberNoDefault()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|nO|no=nay}}', '{{Yesno|nO|no=nay}}')
runYesnoTest(nil, 100)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|0|no=nay}}', '{{Yesno|0|no=nay}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=no|no=nay}}', '{{Yesno|1=no|no=nay}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|beans|no=nay}}', '{{Yesno|beans|no=nay}}')
function suite:testTableNoDefault()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| beans |no=nay}}', '{{Yesno| beans |no=nay}}')
runYesnoTest(nil, {})
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|¬|no=nay}}', '{{Yesno|¬|no=nay}}')
function suite:testFunctionNoDefault()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| ¬ |no=nay}}', '{{Yesno| ¬ |no=nay}}')
runYesnoTest(nil, function() return true end)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1= ¬ |no=nay}}', '{{Yesno|1= ¬ |no=nay}}')
end
end


function p:test_set_yes_no()
function suite:testBlankStringNoDefault()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes=aye|no=nay}}', '{{Yesno|yes=aye|no=nay}}')
runYesnoTest(nil, '')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno||yes=aye|no=nay}}', '{{Yesno||yes=aye|no=nay}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| |yes=aye|no=nay}}', '{{Yesno| |yes=aye|no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|  |yes=aye|no=nay}}', '{{Yesno|  |yes=aye|no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=|yes=aye|no=nay}}', '{{Yesno|1=|yes=aye|no=nay}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yes|yes=aye|no=nay}}', '{{Yesno|yes|yes=aye|no=nay}}')
--------------------------------------------------------------------------------
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|yeS|yes=aye|no=nay}}', '{{Yesno|yeS|yes=aye|no=nay}}')
-- Test default set
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|YES|yes=aye|no=nay}}', '{{Yesno|YES|yes=aye|no=nay}}')
--------------------------------------------------------------------------------
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1|yes=aye|no=nay}}', '{{Yesno|1|yes=aye|no=nay}}')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=yes|yes=aye|no=nay}}', '{{Yesno|1=yes|yes=aye|no=nay}}')


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|no|yes=aye|no=nay}}', '{{Yesno|no|yes=aye|no=nay}}')
function suite:testStringDefaultSet()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|nO|yes=aye|no=nay}}', '{{Yesno|nO|yes=aye|no=nay}}')
runYesnoTestWithDefault('default', 'foo')
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|0|yes=aye|no=nay}}', '{{Yesno|0|yes=aye|no=nay}}')
end
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1=no|yes=aye|no=nay}}', '{{Yesno|1=no|yes=aye|no=nay}}')
 
function suite:testNumberDefaultSet()
runYesnoTestWithDefault('default', 100)
end
 
function suite:testTableDefaultSet()
runYesnoTestWithDefault('default', {})
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|beans|yes=aye|no=nay}}', '{{Yesno|beans|yes=aye|no=nay}}')
function suite:testFunctionDefaultSet()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| beans |yes=aye|no=nay}}', '{{Yesno| beans |yes=aye|no=nay}}')
runYesnoTestWithDefault('default', function() return true end)
end
 
function suite:testBlankStringDefaultSet()
runYesnoTestWithDefault('default', '')
end
 
--------------------------------------------------------------------------------
-- Test default precedence with true, false, and nil
--------------------------------------------------------------------------------
 
function suite:testYesDefaultPrecedence()
runYesnoTestWithDefault(true, 'yes')
end
 
function suite:testYDefaultPrecedence()
runYesnoTestWithDefault(true, 'y')
end
 
function suite:testTrueTextDefaultPrecedence()
runYesnoTestWithDefault(true, 'true')
end
 
function suite:testTrueDefaultPrecedence()
runYesnoTestWithDefault(true, true)
end
 
function suite:testOneTextDefaultPrecedence()
runYesnoTestWithDefault(true, '1')
end
 
function suite:testOneDefaultPrecedence()
runYesnoTestWithDefault(true, 1)
end
 
function suite:testNoDefaultPrecedence()
runYesnoTestWithDefault(false, 'no')
end
 
function suite:testNDefaultPrecedence()
runYesnoTestWithDefault(false, 'n')
end
 
function suite:testFalseTextDefaultPrecedence()
runYesnoTestWithDefault(false, 'false')
end
 
function suite:testFalseDefaultPrecedence()
runYesnoTestWithDefault(false, false)
end
 
function suite:testZeroDefaultPrecedence()
runYesnoTestWithDefault(false, 0)
end
 
function suite:testZeroTextDefaultPrecedence()
runYesnoTestWithDefault(false, '0')
end


    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|¬|yes=aye|no=nay}}', '{{Yesno|¬|yes=aye|no=nay}}')
function suite:testNilDefaultPrecedence()
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno| ¬ |yes=aye|no=nay}}', '{{Yesno| ¬ |yes=aye|no=nay}}')
runYesnoTestWithDefault(nil, nil)
    self:preprocess_equals_preprocess('{{#invoke:Yesno|yesno|1= ¬ |yes=aye|no=nay}}', '{{Yesno|1= ¬ |yes=aye|no=nay}}')
end
end


return p
return suite

Latest revision as of 14:27, 22 December 2021

Documentation for this module may be created at Module:Yesno/testcases/doc

local yesno = require('Module:Yesno')
local yesnoSandbox = require('Module:Yesno/sandbox')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

local function compareLiveAndSandbox(expected, liveValue, sandboxValue)
	local message = "Expected " .. tostring(expected) .. ". Got "
	suite:assertEquals(expected, liveValue, message .. tostring(liveValue)
		.. " from live module.")
	suite:assertEquals(expected, sandboxValue, message .. tostring(sandboxValue)
		.. " from sandbox.")
end

local function runYesnoTest(expected, inputValue)
	local liveValue = yesno(inputValue)
	local sandboxValue = yesnoSandbox(inputValue)
	compareLiveAndSandbox(expected, liveValue, sandboxValue)
end

local function runYesnoTestWithDefault(expected, inputValue)
	local liveValue = yesno(inputValue, 'default')
	local sandboxValue = yesnoSandbox(inputValue, 'default')
	compareLiveAndSandbox(expected, liveValue, sandboxValue)
end

--------------------------------------------------------------------------------
-- Basic tests
--------------------------------------------------------------------------------

function suite:testYes()
	runYesnoTest(true, 'yes')
end

function suite:testY()
	runYesnoTest(true, 'y')
end

function suite:testTrueText()
	runYesnoTest(true, 'true')
end

function suite:testT()
	runYesnoTest(true, 't')
end

function suite:testTrue()
	runYesnoTest(true, true)
end

function suite:testOneText()
	runYesnoTest(true, '1')
end

function suite:testOne()
	runYesnoTest(true, 1)
end

function suite:testOn()
	runYesnoTest(true, 'on')
end

function suite:testNo()
	runYesnoTest(false, 'no')
end

function suite:testN()
	runYesnoTest(false, 'n')
end

function suite:testF()
	runYesnoTest(false, 'f')
end

function suite:testFalseText()
	runYesnoTest(false, 'false')
end

function suite:testFalse()
	runYesnoTest(false, false)
end

function suite:testZero()
	runYesnoTest(false, 0)
end

function suite:testZeroText()
	runYesnoTest(false, '0')
end

function suite:testOff()
	runYesnoTest(false, 'off')
end

function suite:testNil()
	runYesnoTest(nil, nil)
end

--------------------------------------------------------------------------------
-- Capitalisation tests
--------------------------------------------------------------------------------

function suite:testYesCaps()
	runYesnoTest(true, 'Yes')
	runYesnoTest(true, 'YES')
	runYesnoTest(true, 'yEs')
end

function suite:testYCaps()
	runYesnoTest(true, 'Y')
end

function suite:testTCaps()
	runYesnoTest(true, 'T')
end

function suite:testTrueTextCaps()
	runYesnoTest(true, 'True')
	runYesnoTest(true, 'TRUE')
	runYesnoTest(true, 'trUE')
end

function suite:testOnCaps()
	runYesnoTest(true, 'On')
	runYesnoTest(true, 'ON')
	runYesnoTest(true, 'oN')
end

function suite:testNoCaps()
	runYesnoTest(false, 'No')
	runYesnoTest(false, 'NO')
	runYesnoTest(false, 'nO')
end

function suite:testNCaps()
	runYesnoTest(false, 'N')
end

function suite:testFCaps()
	runYesnoTest(false, 'F')
end

function suite:testFalseTextCaps()
	runYesnoTest(false, 'False')
	runYesnoTest(false, 'FALSE')
	runYesnoTest(false, 'fALSe')
end

function suite:testOffCaps()
	runYesnoTest(false, 'ofF')
	runYesnoTest(false, 'oFf')
	runYesnoTest(false, 'oFF')
	runYesnoTest(false, 'Off')
	runYesnoTest(false, 'OfF')
	runYesnoTest(false, 'OFf')
	runYesnoTest(false, 'OFF')
end

--------------------------------------------------------------------------------
-- Number conversion tests
--------------------------------------------------------------------------------

function suite:testOneTextConversion()
	runYesnoTest(true, '1.0')
	runYesnoTest(true, '001')
end

function suite:testZeroTextConversion()
	runYesnoTest(false, '0.0')
	runYesnoTest(false, '000')
end

--------------------------------------------------------------------------------
-- Test no default set
--------------------------------------------------------------------------------

function suite:testStringNoDefault()
	runYesnoTest(nil, 'foo')
end

function suite:testNumberNoDefault()
	runYesnoTest(nil, 100)
end

function suite:testTableNoDefault()
	runYesnoTest(nil, {})
end

function suite:testFunctionNoDefault()
	runYesnoTest(nil, function() return true end)
end

function suite:testBlankStringNoDefault()
	runYesnoTest(nil, '')
end

--------------------------------------------------------------------------------
-- Test default set
--------------------------------------------------------------------------------

function suite:testStringDefaultSet()
	runYesnoTestWithDefault('default', 'foo')
end

function suite:testNumberDefaultSet()
	runYesnoTestWithDefault('default', 100)
end

function suite:testTableDefaultSet()
	runYesnoTestWithDefault('default', {})
end

function suite:testFunctionDefaultSet()
	runYesnoTestWithDefault('default', function() return true end)
end

function suite:testBlankStringDefaultSet()
	runYesnoTestWithDefault('default', '')
end

--------------------------------------------------------------------------------
-- Test default precedence with true, false, and nil
--------------------------------------------------------------------------------

function suite:testYesDefaultPrecedence()
	runYesnoTestWithDefault(true, 'yes')
end

function suite:testYDefaultPrecedence()
	runYesnoTestWithDefault(true, 'y')
end

function suite:testTrueTextDefaultPrecedence()
	runYesnoTestWithDefault(true, 'true')
end

function suite:testTrueDefaultPrecedence()
	runYesnoTestWithDefault(true, true)
end

function suite:testOneTextDefaultPrecedence()
	runYesnoTestWithDefault(true, '1')
end

function suite:testOneDefaultPrecedence()
	runYesnoTestWithDefault(true, 1)
end

function suite:testNoDefaultPrecedence()
	runYesnoTestWithDefault(false, 'no')
end

function suite:testNDefaultPrecedence()
	runYesnoTestWithDefault(false, 'n')
end

function suite:testFalseTextDefaultPrecedence()
	runYesnoTestWithDefault(false, 'false')
end

function suite:testFalseDefaultPrecedence()
	runYesnoTestWithDefault(false, false)
end

function suite:testZeroDefaultPrecedence()
	runYesnoTestWithDefault(false, 0)
end

function suite:testZeroTextDefaultPrecedence()
	runYesnoTestWithDefault(false, '0')
end

function suite:testNilDefaultPrecedence()
	runYesnoTestWithDefault(nil, nil)
end

return suite