Module:Repr/testcases explained

-- Load necessary moduleslocal mRepr = require('Module:Repr')local ScribuntoUnit = require('Module:ScribuntoUnit')

-- Initialise test suitelocal suite = ScribuntoUnit:new

---------------------------------------------------------------------------------- isLuaIdentifier tests--------------------------------------------------------------------------------

local isLuaIdentifierTestData =

for _, testData in ipairs(isLuaIdentifierTestData) do suite[testData.testName] = function(self) local result = mRepr._isLuaIdentifier(testData.value) self:assertEquals(testData.expected, result) endend

local luaKeywords =

for _, keyword in ipairs(luaKeywords) do suite["testIsLuaIdentifier_keyword_" .. keyword .. '_isFalse'] = function(self) self:assertFalse(mRepr._isLuaIdentifier(keyword)) endend

---------------------------------------------------------------------------------- repr tests--------------------------------------------------------------------------------

local TABLE_WITH_IDENTIFIER_KEYS = local TABLE_WITH_IDENTIFIER_KEYS_SORTED_REPR = ''

local CYCLIC_SEQUENCE = table.insert(CYCLIC_SEQUENCE, CYCLIC_SEQUENCE)local CYCLIC_SEQUENCE_REPR = ''

local CYCLIC_TABLE = CYCLIC_TABLE.b= CYCLIC_TABLElocal CYCLIC_TABLE_REPR = ''

local CYCLIC_TABLE_PAIR = CYCLIC_TABLE_PAIR.b.d = CYCLIC_TABLE_PAIRlocal CYCLIC_TABLE_PAIR_REPR = ''

local SUBTABLE = local TABLE_WITH_SHARED_SUBTABLES = local TABLE_WITH_SHARED_SUBTABLES_REPR = ''

local TOSTRING_METAMETHOD_TABLE_REPR = ''local TOSTRING_METATABLE = local TOSTRING_METAMETHOD_TABLE = setmetatable(TOSTRING_METATABLE)local TOSTRING_METATABLE_REPR = ''

local NESTED_TABLE =

local reprTestData =

for _, testData in ipairs(reprTestData) do suite[testData.testName] = function(self) local result = mRepr.repr(unpack(testData.args)) self:assertEquals(testData.expected, result) endend

---------------------------------------------------------------------------------- invocationRepr tests--------------------------------------------------------------------------------

local invocationReprTestData =

for _, testData in ipairs(invocationReprTestData) do suite[testData.testName] = function(self) local result = mRepr.invocationRepr(testData.args) self:assertEquals(testData.expected, result) endend

return suite