3 /* strcspn( const char *, const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 size_t strcspn( const char * s1, const char * s2 )
22 if ( s1[len] == *p++ )
35 #include <_PDCLIB_test.h>
39 TESTCASE( strcspn( abcde, "x" ) == 5 );
40 TESTCASE( strcspn( abcde, "xyz" ) == 5 );
41 TESTCASE( strcspn( abcde, "zyx" ) == 5 );
42 TESTCASE( strcspn( abcdx, "x" ) == 4 );
43 TESTCASE( strcspn( abcdx, "xyz" ) == 4 );
44 TESTCASE( strcspn( abcdx, "zyx" ) == 4 );
45 TESTCASE( strcspn( abcde, "a" ) == 0 );
46 TESTCASE( strcspn( abcde, "abc" ) == 0 );
47 TESTCASE( strcspn( abcde, "cba" ) == 0 );