feat(test/char): adding the unitary test for ft_isprint

- isprint have now the unitary test
This commit is contained in:
Raphael 2025-09-05 10:48:48 +02:00
parent 0282b52326
commit 764097af73
No known key found for this signature in database

36
test/char/test_isprint.c Normal file
View file

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_isprint.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <ctype.h>
#include <stdio.h>
#include <stdlib.h>
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++;
}
}