Module:UnitTests: Difference between revisions

Content deleted Content added
trim some whitespace; no change to actual content
allow a function to be specified in options argument to equals function, to allow customized display of expected and actual
Line 65:
local maybe_nowiki = (options and options.nowiki) and mw.text.nowiki or function(...) return ... end
local differs_at = self.differs_at and (' \n| ' .. first_difference(expected, actual)) or ''
local display = options and options.display or function(x) return x end
result_table = result_table .. ' \n| ' .. name .. ' \n| ' .. maybe_nowiki(tostring(display(expected))) .. ' \n| ' .. maybe_nowiki(tostring(display(actual))) .. differs_at .. "\n|-\n"
end