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