Closed fletcher97 closed 1 year ago
Hello! Thanks for contributing to the libft unit test.
Note that this repository is not maintained by the owner anymore, instead there is a bot that will automatically merge any reviewed pull requests. If you feel like it, here are some links that can help you submiting a change in the code base::
According to C standard section 7.4 paragraph 1:
In your tests you are testing values ranging from -1 to 530 in the is... functions and -100 to 530 in the to... functions. Not sure how this handles in OS X but I'm using linux and it's giving me "FAILED" in some functions like isalnum. The function is literally
return (ft_isalpha(c) || ft_isdigit(c));
and they both isalpha and isdigit passed. The undefined behavior is considering 262 as an alnum according to the c implementation when the input itself is wrong.The test should only go up to 255 and include EOF to avoid comparing undefined behavior as it gives no meaningful information and may fails the program when there is nothing wrong with it.
Exemple (the 262 was the value that failed isalnum and
r:1
is the return of the standard isalnum converted to 0 or 1 so it's returning true):