Module:siwa-noun/testcases: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:
]=]
]=]
}
}
self:iterate(list)
self:iterate(list,"check_output")
end
end


return tests
return tests

Revision as of 13:57, 18 July 2021


All tests passed. (refresh)
Text Expected Actual
test_example:
sivi
|- Unmarked
agentive/dative
Marked
patientive/genitive
Locative
inessive illative elative adessive allative ablative
Contionary:sivi Contionary:sỉd Contionary:sỉdia Contionary:sỉhta Contionary:sỉhka Contionary:sỉhma Contionary:sỉbma, Contionary:sỉddįibma Contionary:sỉska, Contionary:sỉddįiska

local tests = require('Module:UnitTests')
local m_noun = require('Module:siwa-noun')

function tests:check_output(term, expected, noresp)
	return tests:equals(
		term,
		m_noun.make_cases(),
		expected,
		{ show_difference = true }
	)
end

function tests:test_example()
	local list= {
		"sivi",
		[=[
		  |-
		  ! Unmarked<br />''agentive/dative''
		  ! Marked<br />''patientive/genitive''
		  ! Locative
		  |-
		  ! inessive
		  ! illative
		  ! elative
		  ! adessive
		  ! allative
		  ! ablative
		  |-
		  | [[Contionary:sivi]]
		  | [[Contionary:sỉd]]
		  | [[Contionary:sỉdia]]
		  | [[Contionary:sỉhta]]
		  | [[Contionary:sỉhka]]
		  | [[Contionary:sỉhma]]
		  | [[Contionary:sỉbma]], [[Contionary:sỉddįibma]]
		  | [[Contionary:sỉska]], [[Contionary:sỉddįiska]]
		]=]
	}
	self:iterate(list,"check_output")
end

return tests