Module:User:Theknightwho/parser/testcases

Hello, you have come here looking for the meaning of the word Module:User:Theknightwho/parser/testcases. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Theknightwho/parser/testcases, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Theknightwho/parser/testcases in singular and plural. Everything you need to know about the word Module:User:Theknightwho/parser/testcases you have here. The definition of the word Module:User:Theknightwho/parser/testcases will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Theknightwho/parser/testcases, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

Lua error in Module:User:Theknightwho/parser at line 2651: attempt to index global 'tokens' (a nil value)


local tests = require("Module:UnitTests")

local nowiki = require("Module:string utilities").nowiki
local u = mw.ustring.char

local frame = mw.getCurrentFrame()
local parser = require("Module:User:Theknightwho/parser")

function tests:test_variables()
	for _, example in ipairs{"!", "=", "ARTICLEPAGENAME", "ARTICLEPAGENAMEE", "ARTICLEPATH", "ARTICLESPACE", "ARTICLESPACEE", "BASEPAGENAME", "BASEPAGENAMEE", "CASCADINGSOURCES", "CONTENTLANG", "CONTENTLANGUAGE", "CURRENTDAY", "CURRENTDAY2", "CURRENTDAYNAME", "CURRENTDOW", "CURRENTHOUR", "CURRENTMONTH", "CURRENTMONTH1", "CURRENTMONTH2", "CURRENTMONTHABBREV", "CURRENTMONTHNAME", "CURRENTMONTHNAMEGEN", "CURRENTTIME", "CURRENTTIMESTAMP", "CURRENTVERSION", "CURRENTWEEK", "CURRENTYEAR", "DIRECTIONMARK", "DIRMARK", "FULLPAGENAME", "FULLPAGENAMEE", "LOCALDAY", "LOCALDAY2", "LOCALDAYNAME", "LOCALDOW", "LOCALHOUR", "LOCALMONTH", "LOCALMONTH1", "LOCALMONTH2", "LOCALMONTHABBREV", "LOCALMONTHNAME", "LOCALMONTHNAMEGEN", "LOCALTIME", "LOCALTIMESTAMP", "LOCALWEEK", "LOCALYEAR", "NAMESPACE", "NAMESPACEE", "NAMESPACENUMBER", "NOEXTERNALLANGLINKS", "NUMBEROFACTIVEUSERS", "NUMBEROFADMINS", "NUMBEROFARTICLES", "NUMBEROFEDITS", "NUMBEROFFILES", "NUMBEROFPAGES", "NUMBEROFUSERS", "PAGEID", "PAGELANGUAGE", "PAGENAME", "PAGENAMEE", "REVISIONDAY", "REVISIONDAY2", "REVISIONID", "REVISIONMONTH", "REVISIONMONTH1", "REVISIONSIZE", "REVISIONTIMESTAMP", "REVISIONUSER", "REVISIONYEAR", "ROOTPAGENAME", "ROOTPAGENAMEE", "SCRIPTPATH", "SERVER", "SERVERNAME", "SITENAME", "STYLEPATH", "SUBJECTPAGENAME", "SUBJECTPAGENAMEE", "SUBJECTSPACE", "SUBJECTSPACEE", "SUBPAGENAME", "SUBPAGENAMEE", "TALKPAGENAME", "TALKPAGENAMEE", "TALKSPACE", "TALKSPACEE"} do
		example = table.concat{"{{", example, "}}"}
		tests:equals("<code>" .. nowiki(example) .. "</code>", parser:parse(example), frame:really_preprocess(example), {nowiki = true})
	end
end

function tests:test_parser_functions()
	for _, v in ipairs{"URLENCODE"} do
		for i = 0, 127 do
			local example = table.concat{"{{", v, ":" .. u(i) .. "}}"}
			tests:equals("<code>" .. nowiki(example) .. "</code>", parser:parse(example), frame:really_preprocess(example), {nowiki = true})
		end
	end
end

return tests