#include "../src/testing.c" int main(void) { int rc = 0; test_start("testing.c"); const int should_overwrite = 1; if (unsetenv(ENVVAR_NAME)) { perror("unsetenv(\"NO_COLOR\")"); rc = -1; goto out; } { testing("unset NO_COLOR"); test_ok(); } if (setenv(ENVVAR_NAME, "", should_overwrite)) { perror("setenv(\"NO_COLOR\", \"\", 1)"); rc = -1; goto out; } { testing("empty NO_COLOR"); test_ok(); } if (setenv(ENVVAR_NAME, "something", should_overwrite)) { perror("setenv(\"NO_COLOR\", \"something\", 1)"); rc = -1; goto out; } { testing("defined NO_COLOR"); test_ok(); } out: return !!rc; }