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";
|
static char *program_name = "str";
|
||||||
|
|
||||||
|
/* don't use this */
|
||||||
|
#include "isempty.c"
|
||||||
|
|
||||||
|
#include "isvalue.c"
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
char *name;
|
char *name;
|
||||||
int (*f)(int);
|
int (*f)(int);
|
||||||
@ -20,12 +25,18 @@ static struct {
|
|||||||
{ "iscntrl", iscntrl },
|
{ "iscntrl", iscntrl },
|
||||||
{ "isdigit", isdigit },
|
{ "isdigit", isdigit },
|
||||||
{ "isxdigit", isxdigit },
|
{ "isxdigit", isxdigit },
|
||||||
|
#if defined _isempty_c
|
||||||
|
{ "isempty", isempty },
|
||||||
|
#endif
|
||||||
{ "isgraph", isgraph },
|
{ "isgraph", isgraph },
|
||||||
{ "islower", islower },
|
{ "islower", islower },
|
||||||
{ "isprint", isprint },
|
{ "isprint", isprint },
|
||||||
{ "ispunct", ispunct },
|
{ "ispunct", ispunct },
|
||||||
{ "isspace", isspace },
|
{ "isspace", isspace },
|
||||||
{ "isupper", isupper }
|
{ "isupper", isupper }
|
||||||
|
#if defined _isvalue_c
|
||||||
|
, { "isvalue", isvalue }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
|
Loading…
Reference in New Issue
Block a user