hacked new tests in
This commit is contained in:
parent
c1f1794863
commit
14045fdc92
2
str/isempty.c
Normal file
2
str/isempty.c
Normal file
@ -0,0 +1,2 @@
|
||||
#define _isempty_c
|
||||
int isempty(int c){ return 0; }
|
2
str/isvalue.c
Normal file
2
str/isvalue.c
Normal file
@ -0,0 +1,2 @@
|
||||
#define _isvalue_c
|
||||
int isvalue(int c){ return 1; }
|
11
str/str.c
11
str/str.c
@ -10,6 +10,11 @@
|
||||
|
||||
static char *program_name = "str";
|
||||
|
||||
/* don't use this */
|
||||
#include "isempty.c"
|
||||
|
||||
#include "isvalue.c"
|
||||
|
||||
static struct {
|
||||
char *name;
|
||||
int (*f)(int);
|
||||
@ -20,12 +25,18 @@ static struct {
|
||||
{ "iscntrl", iscntrl },
|
||||
{ "isdigit", isdigit },
|
||||
{ "isxdigit", isxdigit },
|
||||
#if defined _isempty_c
|
||||
{ "isempty", isempty },
|
||||
#endif
|
||||
{ "isgraph", isgraph },
|
||||
{ "islower", islower },
|
||||
{ "isprint", isprint },
|
||||
{ "ispunct", ispunct },
|
||||
{ "isspace", isspace },
|
||||
{ "isupper", isupper }
|
||||
#if defined _isvalue_c
|
||||
, { "isvalue", isvalue }
|
||||
#endif
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
|
Loading…
Reference in New Issue
Block a user