X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrspn.c;h=a5859cc2ca89b7b2d544457370fde2a74b6c550a;hb=f486bdde8d103b510fcd0aa6c2e8c5b0c34085e5;hp=d58ec9e46c996cf0d709d3207a00a4d2b2bfcce8;hpb=f5a3525453c158f6b6091587075b527bd569853d;p=pdclib.old diff --git a/functions/string/strspn.c b/functions/string/strspn.c index d58ec9e..a5859cc 100644 --- a/functions/string/strspn.c +++ b/functions/string/strspn.c @@ -33,3 +33,16 @@ size_t strspn( const char * s1, const char * s2 ) } return len; } + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main() +{ + BEGIN_TESTS; + TESTCASE( strspn( abcde, "abc" ) == 3 ); + TESTCASE( strspn( abcde, "b" ) == 0 ); + TESTCASE( strspn( abcde, abcde ) == 5 ); + return TEST_RESULTS; +} +#endif