<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACallAssert</id>
	<title>Module:CallAssert - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ACallAssert"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:CallAssert&amp;action=history"/>
	<updated>2026-06-14T19:30:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:CallAssert&amp;diff=471168&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:CallAssert&amp;diff=471168&amp;oldid=prev"/>
		<updated>2021-07-15T20:53:30Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local function pack(...)&lt;br /&gt;
	return {...}, select('#', ...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function mapArray(func, array, count)&lt;br /&gt;
	local result = {}&lt;br /&gt;
	for i = 1, count or #array do&lt;br /&gt;
		result[i] = func(array[i])&lt;br /&gt;
	end&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function quote(value)&lt;br /&gt;
	if type(value) == 'string' then&lt;br /&gt;
		return (string.gsub(string.format('%q', value), '\\\n', '\\n'))  -- Outer parentheses remove second value returned by gsub&lt;br /&gt;
	end&lt;br /&gt;
	local str = tostring(value)&lt;br /&gt;
	if type(value) == 'table' and str ~= 'table' then&lt;br /&gt;
		return '{' .. str .. '}'&lt;br /&gt;
	end&lt;br /&gt;
	return str&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function callAssert(func, funcName, ...)&lt;br /&gt;
	local result, resultCount = pack(func(...))&lt;br /&gt;
	if not result[1] then&lt;br /&gt;
		local args, argsCount = pack(...)&lt;br /&gt;
		args = mapArray(quote, args, argsCount)&lt;br /&gt;
		local message = mw.ustring.format(&lt;br /&gt;
			'%s(%s) failed',&lt;br /&gt;
			funcName,&lt;br /&gt;
			table.concat(args, ', ')&lt;br /&gt;
		)&lt;br /&gt;
		error(message, 2)&lt;br /&gt;
	end&lt;br /&gt;
	return unpack(result, 1, resultCount)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return callAssert&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>