removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
32
libft/tests/ft_string/ft_str/test_str_isnum.c
Normal file
32
libft/tests/ft_string/ft_str/test_str_isnum.c
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_str_isnum.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/29 08:10:32 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/02 07:44:36 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
|
||||
int test_str_isnum(void)
|
||||
{
|
||||
if (ft_str_isnum("-23") != 1 || ft_str_isnum("+42") != 1 || \
|
||||
ft_str_isnum("0") != 1 || ft_str_isnum("2345865785645643532453") != 1 || \
|
||||
ft_str_isnum("2147483647") != 1)
|
||||
return (1);
|
||||
if (ft_str_isnum("23.3") != 0 || ft_str_isnum("42.0") != 0 || \
|
||||
ft_str_isnum("0.0") != 0 || ft_str_isnum("2.000000") != 0 || \
|
||||
ft_str_isnum("0.000000") != 0 || ft_str_isnum("--2147483648") != 0 || \
|
||||
ft_str_isnum("++2147483648") != 0)
|
||||
return (2);
|
||||
if (ft_str_isnum("") != 0 || ft_str_isnum("+") != 0 || \
|
||||
ft_str_isnum("-") != 0)
|
||||
return (3);
|
||||
if (ft_str_isnum(NULL) != false)
|
||||
return (4);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue