From 0282b523263bb3713559a77a592d729c50f3b2d2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 5 Sep 2025 10:47:44 +0200 Subject: [PATCH] feat(test/char): adding the test for ft_isascii - isascii now is checked by the unitary test --- test/char/test_isascii.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/char/test_isascii.c diff --git a/test/char/test_isascii.c b/test/char/test_isascii.c new file mode 100644 index 0000000..932b79e --- /dev/null +++ b/test/char/test_isascii.c @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/09/04 16:54:42 by rparodi #+# #+# */ +/* Updated: 2025/09/05 10:40:18 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_isascii(c) != isascii(c)) + { + printf("%s✘ Found %i, excepted %i%s\n", CLR_RED, ft_isascii(c), + isascii(c), RESET); + exit(1); + } + else + printf("%s✔%s ", CLR_GREEN, RESET); + c++; + } +}