Modul:pt-subst/test

Definition från Wiktionary, den fria ordlistan.
Hoppa till navigering Hoppa till sök

6 tests failed. (refresh)

Text Expected Actual
test01_m_o:
Script error during testing: Modul:pt-subst/test:9: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:9: in function <Modul:pt-subst/test:8>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
Text Expected Actual
test02_f_a:
Script error during testing: Modul:pt-subst/test:18: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:18: in function <Modul:pt-subst/test:17>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
Text Expected Actual
test03_mf_e:
Script error during testing: Modul:pt-subst/test:28: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:28: in function <Modul:pt-subst/test:26>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
Text Expected Actual
test04_f_the_rest:
Script error during testing: Modul:pt-subst/test:49: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:49: in function <Modul:pt-subst/test:48>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
Text Expected Actual
test04_m_the_rest:
Script error during testing: Modul:pt-subst/test:40: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:40: in function <Modul:pt-subst/test:39>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
Text Expected Actual
test06_mf_the_rest:
Script error during testing: Modul:pt-subst/test:58: attempt to call field 'test' (a nil value)
stack traceback:
	[C]: in function 'test'
	Modul:pt-subst/test:58: in function <Modul:pt-subst/test:57>
	(tail call): ?
	[C]: in function 'xpcall'
	Modul:UnitTests:295: in function <Modul:UnitTests:260>
	(tail call): ?
	mw.lua:527: in function <mw.lua:507>
	[C]: ?
local t = require("Modul:UnitTests")
local mut = require("Modul:pt-subst")

local function nowikiPipe(str)
	return mw.ustring.gsub(str, "|", "<nowiki>|</nowiki>")
end

function t:test01_m_o()
	self:equals_deep('mut.test("-o", "pt-subst-m", "export")', mut.test("-o", "pt-subst-m", "export"), 
		{
			sing_mask="-o",
			plur_mask="-os"
		}
	)
end

function t:test02_f_a()
	self:equals_deep('mut.test("-a", "pt-subst-f", "export")', mut.test("-a", "pt-subst-f", "export"), 
		{
			sing_fem="-a",
			plur_fem="-as"
		}
	)
end

function t:test03_mf_e()
	--stämmer detta?
	self:equals_deep('mut.test("-e", "pt-subst-mf", "export")', mut.test("-e", "pt-subst-mf", "export"), 
		{
			sing_mask="-e",
			plur_mask="-es",
			sing_fem="-e",
			plur_fem="-es"
		}
	)
end


function t:test04_m_the_rest()
	self:equals_deep('mut.test("abc", "pt-subst-m", "export")', mut.test("abc", "pt-subst-m", "export"), 
		{
			sing_mask="abc",
			plur_mask="?" -- irregular or unknown pattern
		}
	)
end

function t:test04_f_the_rest()
	self:equals_deep('mut.test("abc", "pt-subst-f", "export")', mut.test("abc", "pt-subst-f", "export"), 
		{
			sing_fem="abc",
			plur_fem="?" -- irregular or unknown pattern
		}
	)
end

function t:test06_mf_the_rest()
	self:equals_deep('mut.test("abc", "pt-subst-mf", "export")', mut.test("abc", "pt-subst-mf", "export"), 
		{
			sing_mask="abc",
			sing_fem="abc",
			plur_mask="?", -- irregular or unknown pattern
			plur_fem="?" -- irregular or unknown pattern
		}
	)
end

return t