<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://iti-testbed.tugraz.at/index.php?action=history&amp;feed=atom&amp;title=Module%3AQuickTest</id>
	<title>Module:QuickTest - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://iti-testbed.tugraz.at/index.php?action=history&amp;feed=atom&amp;title=Module%3AQuickTest"/>
	<link rel="alternate" type="text/html" href="http://iti-testbed.tugraz.at/wiki/index.php?title=Module:QuickTest&amp;action=history"/>
	<updated>2026-05-04T20:18:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>http://iti-testbed.tugraz.at/wiki/index.php?title=Module:QuickTest&amp;diff=564&amp;oldid=prev</id>
		<title>Schuschu: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://iti-testbed.tugraz.at/wiki/index.php?title=Module:QuickTest&amp;diff=564&amp;oldid=prev"/>
		<updated>2019-11-10T17:37:36Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:37, 10 November 2019&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff::1.12:old-563:rev-564 --&gt;
&lt;/table&gt;</summary>
		<author><name>Schuschu</name></author>
		
	</entry>
	<entry>
		<id>http://iti-testbed.tugraz.at/wiki/index.php?title=Module:QuickTest&amp;diff=563&amp;oldid=prev</id>
		<title>meta&gt;Rillke: Display correct test command</title>
		<link rel="alternate" type="text/html" href="http://iti-testbed.tugraz.at/wiki/index.php?title=Module:QuickTest&amp;diff=563&amp;oldid=prev"/>
		<updated>2016-04-01T23:05:06Z</updated>

		<summary type="html">&lt;p&gt;Display correct test command&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Tests whether a module has a test API, and if so, runs these tests&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.run(titleCurrentPage)&lt;br /&gt;
	local title = titleCurrentPage&lt;br /&gt;
	local titlesplit = mw.text.split(title, '/', true)&lt;br /&gt;
	if titlesplit[1]:find('Module:', 1, true) ~= 1 then return '' end&lt;br /&gt;
	if titlesplit[#titlesplit] == 'doc' then&lt;br /&gt;
		table.remove(titlesplit)&lt;br /&gt;
	end&lt;br /&gt;
	title = table.concat(titlesplit, '/')&lt;br /&gt;
	&lt;br /&gt;
	-- Load the module&lt;br /&gt;
	local m = require(title)&lt;br /&gt;
	local testType = 'public-member'&lt;br /&gt;
	local testFunction = ( (type(m) == 'table') and (getmetatable(m) and getmetatable(m).quickTests or m['runTests']) )&lt;br /&gt;
	local testFunctionType = type(testFunction)&lt;br /&gt;
	if ( (type(m) == 'table') and (getmetatable(m) and getmetatable(m).quickTests) ) then&lt;br /&gt;
		testType = 'meta-table'&lt;br /&gt;
	end&lt;br /&gt;
	if ( testFunctionType ~= 'function' and not ( testFunctionType == 'table' and getmetatable(testFunction).__call ) ) then&lt;br /&gt;
		return '', title, testType&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Execute the test function&lt;br /&gt;
	local ok, result = pcall(testFunction)&lt;br /&gt;
	if ok then&lt;br /&gt;
		return result, title, testType&lt;br /&gt;
	else&lt;br /&gt;
		return 'error', title, testType&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function cat(title, titleCurrentPage, cat)&lt;br /&gt;
	if titleCurrentPage == title then return cat end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.testModule(frame)&lt;br /&gt;
	local titleCurrentPage =  ( frame.args and frame.args.title ) or ( frame and frame:preprocess('{{FULLPAGENAME}}') ) or 'Frame not defined.'&lt;br /&gt;
	local testResult, title, testType = p.run(titleCurrentPage)&lt;br /&gt;
	local testCode = '=p.runTests()'&lt;br /&gt;
&lt;br /&gt;
	if testResult == true then&lt;br /&gt;
		return '[[File:Octicons-check.svg|16px|alt=Quick tests passed|Quick tests passed|link=COM:LUA/T#auto]]' .. cat(title, titleCurrentPage, '[[Category:Scribunto modules with tests passed]]')&lt;br /&gt;
	elseif testResult == false then&lt;br /&gt;
		if testType == 'meta-table' then&lt;br /&gt;
			testCode = '=getmetatable(p).quickTests()'&lt;br /&gt;
		end&lt;br /&gt;
		return '[[File:Octicons-bug.svg|16px|alt=Bug executing tests|Bug executing tests|link=COM:LUA/T#auto]] Run &amp;lt;code&amp;gt;' .. testCode .. '&amp;lt;/code&amp;gt; in the LUA console on [[' .. title .. ']] for more details.' .. cat(title, titleCurrentPage, '[[Category:Scribunto modules with tests failed]]')&lt;br /&gt;
	elseif testResult == 'error' then&lt;br /&gt;
		return '[[File:Octicons-issue-opened.svg|16px|alt=Error|link=COM:LUA/T#auto]] Error executing tests.' .. cat(title, titleCurrentPage, '[[Category:Scribunto modules with errors executing tests]]')&lt;br /&gt;
	else&lt;br /&gt;
		return '[[File:Octicons-megaphone.svg|16px|alt=No test API|link=COM:LUA/T#auto-howto]] '.. testResult .. cat(title, titleCurrentPage, '[[Category:Scribunto modules without test API]]')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.injectResult(frame)&lt;br /&gt;
	local result = p.testModule(frame)&lt;br /&gt;
	if result == '' then return '' end&lt;br /&gt;
	&lt;br /&gt;
	return ( frame.args['pattern']:gsub('%%result%%', result) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local mt = {&lt;br /&gt;
	quickTests = function ()&lt;br /&gt;
		return 'function' == type( p.injectResult )&lt;br /&gt;
	end&lt;br /&gt;
}&lt;br /&gt;
setmetatable(p, mt)&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>meta&gt;Rillke</name></author>
		
	</entry>
</feed>