summaryrefslogtreecommitdiff
path: root/doc/03-assertions.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/03-assertions.html')
-rw-r--r--doc/03-assertions.html89
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>