From 764097af738fc9badfb45f9faf56be1aa2ef661f Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 5 Sep 2025 10:48:48 +0200 Subject: [PATCH] feat(test/char): adding the unitary test for ft_isprint - isprint have now the unitary test --- test/char/test_isprint.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/char/test_isprint.c diff --git a/test/char/test_isprint.c b/test/char/test_isprint.c new file mode 100644 index 0000000..d3fca7e --- /dev/null +++ b/test/char/test_isprint.c @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/09/04 16:54:42 by rparodi #+# #+# */ +/* Updated: 2025/09/05 10:43:55 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "char.h" +#include "color.h" +#include +#include +#include + +int main(void) +{ + unsigned char c; + + c = 0; + while (c <= 128) + { + if (ft_isprint(c) != isprint(c)) + { + printf("%s✘ Found %i, excepted %i%s\n", CLR_RED, ft_isprint(c), + isprint(c), RESET); + exit(1); + } + else + printf("%s✔%s ", CLR_GREEN, RESET); + c++; + } +}