code/modules/unit_tests/_unit_tests.dm

TEST_FAIL | For advanced cases, fail unconditionally but don't return (so a test can return multiple results) |
---|---|
TEST_ASSERT | Asserts that a condition is true If the condition is not true, fails the test |
TEST_ASSERT_NOTNULL | Asserts that a parameter is not null |
TEST_ASSERT_NULL | Asserts that a parameter is null |
TEST_ASSERT_EQUAL | Asserts that the two parameters passed are equal, fails otherwise Optionally allows an additional message in the case of a failure |
TEST_ASSERT_NOTEQUAL | Asserts that the two parameters passed are not equal, fails otherwise Optionally allows an additional message in the case of a failure |
TEST_FOCUS | Only 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 TEST_FOCUS(/datum/unit_test/math) |
TEST_NOTICE | Logs a noticable message on GitHub, but will not mark as an error. Use this when something shouldn't happen and is of note, but shouldn't block CI. Does not mark the test as failed. |
UNIT_TEST_PASSED | Constants indicating unit test completion status |
Define Details
TEST_ASSERT
Asserts that a condition is true If the condition is not true, fails the test
TEST_ASSERT_EQUAL
Asserts that the two parameters passed are equal, fails otherwise Optionally allows an additional message in the case of a failure
TEST_ASSERT_NOTEQUAL
Asserts that the two parameters passed are not equal, fails otherwise Optionally allows an additional message in the case of a failure
TEST_ASSERT_NOTNULL
Asserts that a parameter is not null
TEST_ASSERT_NULL
Asserts that a parameter is null
TEST_FAIL
For advanced cases, fail unconditionally but don't return (so a test can return multiple results)
TEST_FOCUS
Only 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 TEST_FOCUS(/datum/unit_test/math)
TEST_NOTICE
Logs a noticable message on GitHub, but will not mark as an error. Use this when something shouldn't happen and is of note, but shouldn't block CI. Does not mark the test as failed.
UNIT_TEST_PASSED
Constants indicating unit test completion status