]> git.sur5r.net Git - cc65/blob - testcode/lib/strpbrk-test.c
Fixed strpbrk().
[cc65] / testcode / lib / strpbrk-test.c
1 #include <stdio.h>
2 #include <string.h>
3
4 static const char fox[] = "The quick brown fox jumped over the lazy dogs.";
5
6 void main (void)
7 {
8     printf ("Testing strpbrk():\n");
9     if (strpbrk (fox, "qwerty") != &fox[2]) {
10         printf ("\nThe first 'e' wasn't found.\n");
11     }
12     if (strpbrk (fox, "QWERTY") != &fox[0]) {
13         printf ("The 'T' wasn't found.\n");
14     }
15     if (strpbrk (fox, "asdfg") != &fox[16]) {
16         printf ("The 'f' wasn't found.\n");
17     }
18     if (strpbrk (fox, "nxv,zmb") != &fox[10]) {
19         printf ("The 'b'  wasn't found.\n");
20     }
21     if (strpbrk (fox, "!@#$%^&*()-+=[];:',/?<>.") != &fox[45]) {
22         printf ("The '.' wasn't found.\n");
23     }
24
25     printf ("\nFinished.\n");
26 }