2023-06-12 14:27:02 -04:00
|
|
|
main()
|
|
|
|
{
|
|
|
|
local str;
|
2023-06-18 13:43:39 -04:00
|
|
|
|
2023-06-12 14:27:02 -04:00
|
|
|
name = "strchr";
|
2023-06-18 13:43:39 -04:00
|
|
|
|
2023-06-12 14:27:02 -04:00
|
|
|
str = "bozoman du 36";
|
2023-06-18 06:39:18 -04:00
|
|
|
test_str(strchr(str, 'z'), str + 2, "");
|
|
|
|
test_str(strchr(str, 0), str + 13, "");
|
|
|
|
test_str(strchr(str, '5'), 0, "");
|
|
|
|
test_str(strchr(str, '6'), str + 12, "");
|
2023-06-18 13:43:39 -04:00
|
|
|
test_str(strchr("", 'q'), 0, "empty str");
|
|
|
|
test_str(strchr("", 0), "", "empty str and \0 to find");
|
2023-06-12 14:27:02 -04:00
|
|
|
}
|