<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="uk">
	<id>https://wiki.court.gov.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ANo_globals%2Ftestcases</id>
	<title>Модуль:No globals/testcases - Історія редагувань</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.court.gov.ua/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ANo_globals%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://wiki.court.gov.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:No_globals/testcases&amp;action=history"/>
	<updated>2026-04-26T06:38:40Z</updated>
	<subtitle>Історія редагувань цієї сторінки в вікі</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.court.gov.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:No_globals/testcases&amp;diff=1329&amp;oldid=prev</id>
		<title>Tviggy: Імпортовано 1 версія</title>
		<link rel="alternate" type="text/html" href="https://wiki.court.gov.ua/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:No_globals/testcases&amp;diff=1329&amp;oldid=prev"/>
		<updated>2020-09-21T09:52:16Z</updated>

		<summary type="html">&lt;p&gt;Імпортовано 1 версія&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Нова сторінка&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = require('Module:ScribuntoUnit'):new()&lt;br /&gt;
&lt;br /&gt;
-- Allow test runner to use both the Module:XXX itself and Module:XXX/sandbox with the same testcases&lt;br /&gt;
function p:module()&lt;br /&gt;
	return self.frame and self.frame.args and self.frame.args.module or 'No globals'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p:test()&lt;br /&gt;
	require('Module:' .. p:module())&lt;br /&gt;
	&lt;br /&gt;
	-- try returning undeclared variable&lt;br /&gt;
	self:assertThrows(function() return foo end, &amp;quot;Tried to read nil global foo&amp;quot;, 'test1')&lt;br /&gt;
	&lt;br /&gt;
	-- try writing to an undeclared variable&lt;br /&gt;
	self:assertThrows(function() bar = 0 end, &amp;quot;Tried to write global bar&amp;quot;, 'test2')&lt;br /&gt;
	&lt;br /&gt;
	-- try reading and writing to variable arg -- should be exempt, and cause no errors&lt;br /&gt;
	local tmp = arg&lt;br /&gt;
	arg = arg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Tviggy</name></author>
	</entry>
</feed>