summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-04-18 15:59:03 -0300
committerEuAndreh <eu@euandre.org>2024-04-18 15:59:03 -0300
commitde381b68afed455b5be5e669ec6db57087f48aa5 (patch)
tree3629bb82dbb7b584e0406f15016e035da96a5c09 /tests
parentsrc/string.c: Add new empty file structure (diff)
downloadpindaiba-de381b68afed455b5be5e669ec6db57087f48aa5.tar.gz
pindaiba-de381b68afed455b5be5e669ec6db57087f48aa5.tar.xz
src/testing.c: Fix show_colour() logic; add it to tests
Diffstat (limited to 'tests')
-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;
}