0014-strcoll.c (433B)
1 #include <assert.h> 2 #include <stdio.h> 3 #include <assert.h> 4 #include <stdio.h> 5 #include <string.h> 6 7 /* 8 output: 9 testing 10 done 11 end: 12 */ 13 14 int 15 main() 16 { 17 puts("testing"); 18 19 assert(strcoll("abcd", "abcd") == 0); 20 assert(strcoll("abcd", "a") > 0); 21 assert(strcoll("a", "abcd") < 0); 22 assert(strcoll("aa", "ab") < 0); 23 assert(strcoll("ab", "aa") > 0); 24 assert(strcoll("", "a") < 0); 25 assert(strcoll("a", "") > 0); 26 27 puts("done"); 28 29 return 0; 30 }