]> pd.if.org Git - pdclib/blobdiff - functions/string/strspn.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / string / strspn.c
index d58ec9e46c996cf0d709d3207a00a4d2b2bfcce8..8869a846834607887a9c25bc50aef3f9baf2fc9c 100644 (file)
@@ -1,7 +1,3 @@
-/* $Id$ */
-
-/* Release $Name$ */
-
 /* strspn( const char *, const char * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -10,6 +6,8 @@
 
 #include <string.h>
 
+#ifndef REGTEST
+
 size_t strspn( const char * s1, const char * s2 )
 {
     size_t len = 0;
@@ -33,3 +31,17 @@ size_t strspn( const char * s1, const char * s2 )
     }
     return len;
 }
+
+#endif
+
+#ifdef TEST
+#include "_PDCLIB_test.h"
+
+int main( void )
+{
+    TESTCASE( strspn( abcde, "abc" ) == 3 );
+    TESTCASE( strspn( abcde, "b" ) == 0 );
+    TESTCASE( strspn( abcde, abcde ) == 5 );
+    return TEST_RESULTS;
+}
+#endif