summaryrefslogtreecommitdiff
path: root/tests/testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testing.c')
-rw-r--r--tests/testing.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/testing.c b/tests/testing.c
index eeb0a39..3c605a7 100644
--- a/tests/testing.c
+++ b/tests/testing.c
@@ -1,18 +1,21 @@
#include "../src/testing.c"
+#include <assert.h>
+
int
main(void) {
- int rc = -1;
+ int rc = 1;
test_start("testing.c");
- const int should_overwrite = 1;
+ const bool should_overwrite = true;
if (unsetenv(ENVVAR_NAME)) {
perror("unsetenv(\"NO_COLOR\")");
goto out;
}
{
+ assert(show_colour() == true);
testing("unset NO_COLOR");
test_ok();
}
@@ -22,6 +25,7 @@ main(void) {
goto out;
}
{
+ assert(show_colour() == true);
testing("empty NO_COLOR");
test_ok();
}
@@ -31,11 +35,12 @@ main(void) {
goto out;
}
{
+ assert(show_colour() == false);
testing("defined NO_COLOR");
test_ok();
}
rc = 0;
out:
- return !!rc;
+ return rc;
}