Module:Hatnote list/testcases

From MOASSpedia
Jump to navigation Jump to search

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

local mHatnoteList = require('Module:Hatnote list/sandbox') -- the module to be tested
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function suite:testAndList()
	self:assertEquals("Foo, Bar, and Baz", mHatnoteList.andList({"Foo", "Bar", "Baz"}))
end

function suite:testOrList()
	self:assertEquals("Foo, Bar, or Baz", mHatnoteList.orList({"Foo", "Bar", "Baz"}))
end

function suite:testForSee()
	self:assertEquals(
		"For Foo, see [[:Bar]]. For Baz, see [[:Qux]].",
		mHatnoteList._forSee({"Foo", "Bar", "Baz", "Qux"})
	)
end

return suite