scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0061-wcsspn.c (374B)


      1 #include <assert.h>
      2 #include <stdio.h>
      3 #include <wchar.h>
      4 
      5 /*
      6 output:
      7 testing
      8 done
      9 end:
     10 */
     11 
     12 int
     13 main()
     14 {
     15 	puts("testing");
     16 	assert(wcsspn(L"abccdef", L"cba") == 4);
     17 	assert(wcsspn(L"abcg", L"cba0") == 3);
     18 	assert(wcsspn(L"", L"abc") == 0);
     19 	assert(wcsspn(L"abc", L"") == 0);
     20 	assert(wcsspn(L"", L"") == 0);
     21 	assert(wcsspn(L"abc", L"def") == 0);
     22 	puts("done");
     23 
     24 	return 0;
     25 }