11 lines
5.2 KiB
HTML
11 lines
5.2 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../../"><link rel="stylesheet" href="dmdoc.css"><title>code/modules/unit_tests/_unit_tests.dm - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="code/modules/unit_tests/_unit_tests.html#define">Define Details</a></header><main><h1>code/modules/unit_tests/_unit_tests.dm <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm0"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm0"></a></h1><table class="summary" cellspacing="0"><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/TEST_ASSERT">TEST_ASSERT</a></th><td>Asserts that a condition is true
|
|
If the condition is not true, fails the test</td></tr><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/TEST_ASSERT_EQUAL">TEST_ASSERT_EQUAL</a></th><td>Asserts that the two parameters passed are equal, fails otherwise
|
|
Optionally allows an additional message in the case of a failure</td></tr><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/TEST_ASSERT_NOTEQUAL">TEST_ASSERT_NOTEQUAL</a></th><td>Asserts that the two parameters passed are not equal, fails otherwise
|
|
Optionally allows an additional message in the case of a failure</td></tr><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/TEST_FOCUS">TEST_FOCUS</a></th><td><em>Only</em> run the test provided within the parentheses
|
|
This is useful for debugging when you want to reduce noise, but should never be pushed
|
|
Intended to be used in the manner of <code>TEST_FOCUS(/datum/unit_test/math)</code></td></tr><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/UNIT_TEST_PASSED">UNIT_TEST_PASSED</a></th><td>Constants indicating unit test completion status</td></tr><tr><th><a href="code/modules/unit_tests/_unit_tests.html#define/TRAIT_SOURCE_UNIT_TESTS">TRAIT_SOURCE_UNIT_TESTS</a></th><td>A trait source when adding traits through unit tests</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/TEST_ASSERT"><aside class="declaration">#define </aside>TEST_ASSERT<aside>(assertion, reason)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L8"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 8"></a></h3><p>Asserts that a condition is true
|
|
If the condition is not true, fails the test</p><h3 id="define/TEST_ASSERT_EQUAL"><aside class="declaration">#define </aside>TEST_ASSERT_EQUAL<aside>(a, b, message)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L12"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 12"></a></h3><p>Asserts that the two parameters passed are equal, fails otherwise
|
|
Optionally allows an additional message in the case of a failure</p><h3 id="define/TEST_ASSERT_NOTEQUAL"><aside class="declaration">#define </aside>TEST_ASSERT_NOTEQUAL<aside>(a, b, message)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L22"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 22"></a></h3><p>Asserts that the two parameters passed are not equal, fails otherwise
|
|
Optionally allows an additional message in the case of a failure</p><h3 id="define/TEST_FOCUS"><aside class="declaration">#define </aside>TEST_FOCUS<aside>(test_path)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L33"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 33"></a></h3><p><em>Only</em> run the test provided within the parentheses
|
|
This is useful for debugging when you want to reduce noise, but should never be pushed
|
|
Intended to be used in the manner of <code>TEST_FOCUS(/datum/unit_test/math)</code></p><h3 id="define/TRAIT_SOURCE_UNIT_TESTS"><aside class="declaration">#define </aside>TRAIT_SOURCE_UNIT_TESTS <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L44"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 44"></a></h3><p>A trait source when adding traits through unit tests</p><h3 id="define/UNIT_TEST_PASSED"><aside class="declaration">#define </aside>UNIT_TEST_PASSED <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/unit_tests/_unit_tests.dm#L36"><img src="git.png" width="16" height="16" title="code/modules/unit_tests/_unit_tests.dm 36"></a></h3><p>Constants indicating unit test completion status</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html> |