added a 75th test with complex entry : %*[^:]%*2c%[^\n]%n : with result OK
This commit is contained in:
parent
5096c803dd
commit
60d950e37c
|
@ -652,12 +652,21 @@ main(void)
|
|||
// #73 : rd 1[^] : []] cn=1 rt=1
|
||||
|
||||
clear();
|
||||
|
||||
ret = sscanf( "]abcdefghij", "%5[^]a-z0-9A-Z-]%n", str, &n );
|
||||
assert( strcmp(str, "........................")==0 && n==-20 && ret==0 );
|
||||
dprint( 1, 140, C_BLACK, "#74 : rd 1[^] : [%s] cn=%d rt=%d", str, n, ret );
|
||||
dupdate();
|
||||
// #74 : rd 1[^] : [........................] cn=-20 rt=0
|
||||
|
||||
clear();
|
||||
char str3[50] = "................................................";
|
||||
ret = sscanf( "Any combi: You can to use any combi.\n", "%*[^:]%*2c%[^\n]%n", str3, &n );
|
||||
assert( strcmp(str3, "You can to use any combi.")==0 && n==36 && ret==1 );
|
||||
dprint( 1, 150, C_BLACK, "#75 : rd 1[^] : [%s] cn=%d rt=%d", str3, n, ret );
|
||||
dupdate();
|
||||
// #75 : rd 1[^] : [You can to use any combi.] cn=36 rt=1
|
||||
|
||||
getkey();
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue