removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
38
libft/tests/ft_string/ft_str/test_str_ishex.c
Normal file
38
libft/tests/ft_string/ft_str/test_str_ishex.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_str_ishex.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/29 08:10:32 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/02 07:44:10 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
|
||||
int test_str_ishex(void)
|
||||
{
|
||||
if (ft_str_ishex("0123456789abcdefABCDEF") != 1)
|
||||
return (1);
|
||||
if (ft_str_ishex("0xdeadbeef") != 1 || ft_str_ishex("0xDEADBEEF") != 1)
|
||||
return (2);
|
||||
if (ft_str_ishex("0xdeadbeefg") != 0 || ft_str_ishex("0xDEADBEEFG") != 0)
|
||||
return (3);
|
||||
if (ft_str_ishex("0x") != 0 || ft_str_ishex("0X") != 0)
|
||||
return (4);
|
||||
if (ft_str_ishex("0x+32") != 0 || ft_str_ishex("0x-32") != 0)
|
||||
return (5);
|
||||
if (ft_str_ishex("0x0x") != 0 || ft_str_ishex("0X0X") != 0)
|
||||
return (6);
|
||||
if (ft_str_ishex("-0x0") != 0 || ft_str_ishex("+0X0") != 0)
|
||||
return (7);
|
||||
if (ft_str_ishex("0x0") != 1 || ft_str_ishex("0X0") != 1)
|
||||
return (8);
|
||||
if (ft_str_ishex("") != 0)
|
||||
return (8);
|
||||
if (ft_str_ishex(NULL) != false)
|
||||
return (9);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue