Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** my_str_isalpha | ||
4 | ** File description: | ||
5 | ** return 1 if str is alphabet character only and 0 if not | ||
6 | */ | ||
7 | |||
8 | #include "my.h" | ||
9 | |||
10 | 10 | int my_str_isalpha(char const *str) | |
11 | { | ||
12 |
2/2✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
|
10 | if (my_strlen(str) == 0) |
13 | 1 | return 1; | |
14 |
2/2✓ Branch 1 taken 30 times.
✓ Branch 2 taken 6 times.
|
36 | for (int i = 0; i < my_strlen(str); i++) { |
15 |
5/6✓ Branch 0 taken 27 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 21 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 21 times.
✗ Branch 5 not taken.
|
30 | if (str[i] < 'A' || (str[i] > 'Z' && str[i] < 'a') |
16 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 27 times.
|
27 | || str[i] > 'z') |
17 | 3 | return 0; | |
18 | } | ||
19 | 6 | return 1; | |
20 | } | ||
21 |