<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=LuaAPI%2Funit_test</id>
	<title>LuaAPI/unit test - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=LuaAPI%2Funit_test"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;action=history"/>
	<updated>2026-05-04T19:27:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=72719&amp;oldid=prev</id>
		<title>Laela at 18:05, 18 April 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=72719&amp;oldid=prev"/>
		<updated>2024-04-18T18:05:11Z</updated>

		<summary type="html">&lt;p&gt;&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 18:05, 18 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot; &gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outcome of a unit test is determined by the first failed assert or the first call to '''succeed'''() or '''finish'''(). All tests must call at least one of '''fail''', '''succeed''' or '''finish''', otherwise they will never end. A common idiom is to call '''succeed''' at the end of the test.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outcome of a unit test is determined by the first failed assert or the first call to '''succeed'''() or '''finish'''(). All tests must call at least one of '''fail''', '''succeed''' or '''finish''', otherwise they will never end. A common idiom is to call '''succeed''' at the end of the test.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Functions ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== unit_test.fail ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== unit_test.fail ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Laela</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=69792&amp;oldid=prev</id>
		<title>Celtic Minstrel: Note that it's not even manually loadable outside [test]</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=69792&amp;oldid=prev"/>
		<updated>2022-07-25T06:08:13Z</updated>

		<summary type="html">&lt;p&gt;Note that it&amp;#039;s not even manually loadable outside [test]&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 06:08, 25 July 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;tright&amp;quot;&amp;gt; __TOC__ &amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;tright&amp;quot;&amp;gt; __TOC__ &amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;unit_test&amp;lt;/tt&amp;gt; module contains functions for writing unit tests that can be run using Wesnoth's &amp;lt;tt&amp;gt;--unit&amp;lt;/tt&amp;gt; command-line option (or its abbreviated form &amp;lt;tt&amp;gt;-u&amp;lt;/tt&amp;gt;). The module is only loaded in scenarios defined using a &amp;lt;tt&amp;gt;[test]&amp;lt;/tt&amp;gt; tag.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;tt&amp;gt;unit_test&amp;lt;/tt&amp;gt; module contains functions for writing unit tests that can be run using Wesnoth's &amp;lt;tt&amp;gt;--unit&amp;lt;/tt&amp;gt; command-line option (or its abbreviated form &amp;lt;tt&amp;gt;-u&amp;lt;/tt&amp;gt;). The module is only loaded in scenarios defined using a &amp;lt;tt&amp;gt;[test]&amp;lt;/tt&amp;gt; tag&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. At present, there is no way to load it in other scenarios&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outcome of a unit test is determined by the first failed assert or the first call to '''succeed'''() or '''finish'''(). All tests must call at least one of '''fail''', '''succeed''' or '''finish''', otherwise they will never end. A common idiom is to call '''succeed''' at the end of the test.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The outcome of a unit test is determined by the first failed assert or the first call to '''succeed'''() or '''finish'''(). All tests must call at least one of '''fail''', '''succeed''' or '''finish''', otherwise they will never end. A common idiom is to call '''succeed''' at the end of the test.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Celtic Minstrel</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=69680&amp;oldid=prev</id>
		<title>Celtic Minstrel: /* unit_test.fire_wml_menu_item */ This is not the wesnoth module…!</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=69680&amp;oldid=prev"/>
		<updated>2022-06-28T03:56:28Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;unit_test.fire_wml_menu_item: &lt;/span&gt; This is not the wesnoth module…!&lt;/span&gt;&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 03:56, 28 June 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot; &gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== unit_test.fire_wml_menu_item ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== unit_test.fire_wml_menu_item ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;wesnoth&lt;/del&gt;.fire_wml_menu_item'''(''id'', ''location'') &amp;amp;rarr; ''success''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;unit_test&lt;/ins&gt;.fire_wml_menu_item'''(''id'', ''location'') &amp;amp;rarr; ''success''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Fires a WML menu item with the given ID as if the mouse were hovering the given location, and returns a boolean indicating whether an event was actually fired.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Fires a WML menu item with the given ID as if the mouse were hovering the given location, and returns a boolean indicating whether an event was actually fired.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Celtic Minstrel</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=68277&amp;oldid=prev</id>
		<title>Celtic Minstrel: Document the unit_test module</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=LuaAPI/unit_test&amp;diff=68277&amp;oldid=prev"/>
		<updated>2021-07-04T22:59:34Z</updated>

		<summary type="html">&lt;p&gt;Document the unit_test module&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;tright&amp;quot;&amp;gt; __TOC__ &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;unit_test&amp;lt;/tt&amp;gt; module contains functions for writing unit tests that can be run using Wesnoth's &amp;lt;tt&amp;gt;--unit&amp;lt;/tt&amp;gt; command-line option (or its abbreviated form &amp;lt;tt&amp;gt;-u&amp;lt;/tt&amp;gt;). The module is only loaded in scenarios defined using a &amp;lt;tt&amp;gt;[test]&amp;lt;/tt&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
The outcome of a unit test is determined by the first failed assert or the first call to '''succeed'''() or '''finish'''(). All tests must call at least one of '''fail''', '''succeed''' or '''finish''', otherwise they will never end. A common idiom is to call '''succeed''' at the end of the test.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.fail ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.fail'''()&lt;br /&gt;
&lt;br /&gt;
Marks the unit test as failed.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.succeed ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.succeed'''()&lt;br /&gt;
&lt;br /&gt;
Marks the unit test as successful, provided no prior assertions failed.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.finish ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.finish'''(''result'')&lt;br /&gt;
&lt;br /&gt;
Marks the unit test as finished. The result can take on several values, the most common being ''fail'' or ''pass''. Unless you need to use a special result, you should call either '''fail''' or '''succeed''' instead.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.log ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.log'''(''prefix'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Logs a message to the Wesnoth console output, using '''std_print'''. The message will be of the form &amp;quot;prefix: message&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.tostring ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.tostring''' &amp;amp;harr; ''function''(''value'') &amp;amp;rarr; ''string''&lt;br /&gt;
&lt;br /&gt;
Converts a value to a string for the purpose of outputting in assertion test failure messages. This can be called directly, and will output strings as quoted and other values as vanilla '''tostring'''. If you need to output some more complex value, you can override it for the special case.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.fire_wml_menu_item ===&lt;br /&gt;
&lt;br /&gt;
* '''wesnoth.fire_wml_menu_item'''(''id'', ''location'') &amp;amp;rarr; ''success''&lt;br /&gt;
&lt;br /&gt;
Fires a WML menu item with the given ID as if the mouse were hovering the given location, and returns a boolean indicating whether an event was actually fired.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If used with menu items that have '''needs_select=yes''', be sure to select a unit first with '''wesnoth.units.select''', otherwise the game might crash.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert'''(''condition'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that the specified condition is true. The message should describe the meaning of the ''condition'' somehow; the simplest way to do this is to copy-paste the condition as a string.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_equal ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_equal'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is equal to ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_not_equal ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_not_equal'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is not equal to ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_approx_equal ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_approx_equal'''(''a'', ''b'', ''tolerance'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is approximately equal to ''b'' within the specified tolerance. Use this if you need to compare real (ie floating-point) numbers. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_greater ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_greater'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is greater than ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_greater_equal ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_greater_equal'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is greater than or equal to ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_less ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_less'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is less than ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_less_equal ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_less_equal'''(''a'', ''b'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that ''a'' is less than or equal to ''b''. The message should describe the meaning of ''a'' and ''b'' somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_in_range ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_in_range'''(''value'', ''minimum'', ''maximum'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Asserts that ''value'' is within the range [''minimum'', ''maximum''] (that is, inclusive of both ends). The messag should describe the meaning of ''value'' somehow. If ''minimum'' and ''maximum'' are expressions, it should describe them too.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_contains ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_contains'''(''source'', ''fragment'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Asserts that the ''source'' string contains the ''fragment'' string as a substring. The message should describe the meaning of these strings somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_nothrow ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_nothrow'''(''function'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that the ''function'' runs without raising an error. The function is run in a protected context, so even if it raises an error, the test will continue. The message should describe the function somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_throws ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_throws'''(''function'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that the ''function'' raises an error when run. The function is run in a protected context, so even if it raises an error, the test will continue. The message should describe the function somehow.&lt;br /&gt;
&lt;br /&gt;
=== unit_test.assert_throws_with ===&lt;br /&gt;
&lt;br /&gt;
* '''unit_test.assert_throws_with'''(''error'', ''function'', ''message'')&lt;br /&gt;
&lt;br /&gt;
Assert that the ''function'' raises an error when run and that the error raised either contains ''error'' as a substring or compares equal to ''error''. The function is run in a protected context, so even if it raises an error, the test will continue. The message should describe the function somehow.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua Reference]]&lt;/div&gt;</summary>
		<author><name>Celtic Minstrel</name></author>
		
	</entry>
</feed>