From bf71f069d4861ba2285c96dd98bdf1bbe0322fc2 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 30 Dec 2022 21:22:50 -0600 Subject: begin documentation and add lily_begin() and lily_finish() --- doc/03-assertions.html | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 doc/03-assertions.html (limited to 'doc/03-assertions.html') 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 @@ + + + + + + + Assertions | lily-test + + +
+ +
+ + +

Assertions

+ +

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.

+ +

Check Macros

+ +

CHECK(x)

+ +

Marks the test as failed if x is false and prints stringified x.

+ +

CHECK_EQ(x, y, fmt)

+ +

Marks the test as failed if x == y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

CHECK_NEQ(x, y, fmt)

+ +

Marks the test as failed if x != y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

CHECK_LT(x, y, fmt)

+ +

Marks the test as failed if x < y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

CHECK_LE(x, y, fmt)

+ +

Marks the test as failed if x <= y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

CHECK_GT(x, y, fmt)

+ +

Marks the test as failed if x > y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

CHECK_GE(x, y, fmt)

+ +

Marks the test as failed if x >= y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +
+ +

Require Macros

+ +

REQUIRE(x)

+ +

Marks the test as failed and immediately ends test execution if x is false and prints stringified x.

+ +

REQUIRE_EQ(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x == y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

REQUIRE_NEQ(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x != y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

REQUIRE_LT(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x < y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

REQUIRE_LE(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x <= y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

REQUIRE_GT(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x > y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + +

REQUIRE_GE(x, y, fmt)

+ +

Marks the test as failed and immediately ends test execution if x >= y is false. Prints both the stringified names of x and y as well as their values, using the printf format code provided in fmt. + + +

+
+ + + -- cgit v1.2.1