diff options
author | sanine <sanine.not@pm.me> | 2022-12-30 21:22:50 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-12-30 21:22:50 -0600 |
commit | bf71f069d4861ba2285c96dd98bdf1bbe0322fc2 (patch) | |
tree | 454cdcd335a408b8a4c1c1b038b152363335dcc2 /doc/03-assertions.html | |
parent | b8c647c9250b514a5daa11ea731691b19944aa4e (diff) |
begin documentation and add lily_begin() and lily_finish()
Diffstat (limited to 'doc/03-assertions.html')
-rw-r--r-- | doc/03-assertions.html | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/doc/03-assertions.html b/doc/03-assertions.html new file mode 100644 index 0000000..92126a8 --- /dev/null +++ b/doc/03-assertions.html @@ -0,0 +1,89 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="style.css"> + <title>Assertions | lily-test</title> +</head> +<body> + <div id="flex-root"> + <iframe id="toc" src="table-of-contents.html"></iframe> + <div id="content"> + + + <h1>Assertions</h1> + + <p>There are two different basic types of assertions: checks and requirements. Both checks and requires will mark the overall test as failed if they are false, but a require will also immediately stop executing the test in addition.<p> + + <h2>Check Macros</h2> + + <h3>CHECK(x)</h3> + + <p>Marks the test as failed if <code>x</code> is false and prints stringified <code>x</code>.</p> + + <h3>CHECK_EQ(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x == y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>CHECK_NEQ(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x != y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>CHECK_LT(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x < y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>CHECK_LE(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x <= y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>CHECK_GT(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x > y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>CHECK_GE(x, y, fmt)</h3> + + <p>Marks the test as failed if <code>x >= y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <br> + + <h2>Require Macros</h2> + + <h3>REQUIRE(x)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x</code> is false and prints stringified <code>x</code>.</p> + + <h3>REQUIRE_EQ(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x == y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>REQUIRE_NEQ(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x != y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>REQUIRE_LT(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x < y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>REQUIRE_LE(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x <= y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>REQUIRE_GT(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x > y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + <h3>REQUIRE_GE(x, y, fmt)</h3> + + <p>Marks the test as failed and immediately ends test execution if <code>x >= y</code> is false. Prints both the stringified names of <code>x</code> and <code>y</code> as well as their values, using the printf format code provided in <code>fmt</code>. + + + </div> + </div> + <div id="footer"> + <a id="prev" href="02-writing-tests.html">⇐ Previous</a> + <a id="next" href="#">Next ⇒</a> + </div> +</body> +</html> |