removing the libft of rparodi
This commit is contained in:
parent
0391323626
commit
be6038dcc8
523 changed files with 724 additions and 3336 deletions
35
libft/tests/ft_string/ft_str/test_strchr.c
Normal file
35
libft/tests/ft_string/ft_str/test_strchr.c
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_strchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/26 11:12:40 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/06/02 07:51:50 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ft_string.h"
|
||||
|
||||
int test_strchr(void)
|
||||
{
|
||||
char *str;
|
||||
char s;
|
||||
char s2;
|
||||
char *res;
|
||||
|
||||
str = "Hello World!";
|
||||
s = 'o';
|
||||
s2 = 'z';
|
||||
res = ft_strchr(str, s);
|
||||
if (res != str + 4)
|
||||
return (1);
|
||||
res = ft_strchr(str, s2);
|
||||
if (res)
|
||||
return (2);
|
||||
res = ft_strchr(str, '\0');
|
||||
if (res != str + ft_strlen(str))
|
||||
return (3);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue