diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-07-17 23:03:51 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-07-17 23:03:51 +0000 |
commit | 76580da6c1bc3291ac304cded70acee596061c1c (patch) | |
tree | 11c7f93c379fc6af0d531dd839b2f5e243e8e3f2 /usr.bin/make | |
parent | f726675da85a1c25e47a171f7efaa49fd01f1b2b (diff) |
Str_Match returns TRUE or FALSE, better style to test those rather
than 1 or 0.
Diffstat (limited to 'usr.bin/make')
-rw-r--r-- | usr.bin/make/regress.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/usr.bin/make/regress.c b/usr.bin/make/regress.c index d228bf10922..60fe9072382 100644 --- a/usr.bin/make/regress.c +++ b/usr.bin/make/regress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: regress.c,v 1.1 2000/07/17 23:01:20 espie Exp $ */ +/* $OpenBSD: regress.c,v 1.2 2000/07/17 23:03:50 espie Exp $ */ /* * Copyright (c) 1999 Marc Espie. @@ -43,29 +43,30 @@ do { \ } \ } while (0); -int main() +int +main() { - unsigned errors = 0; + unsigned int errors = 0; - CHECK(Str_Match("string", "string") == 1); - CHECK(Str_Match("string", "string2") == 0); - CHECK(Str_Match("string", "string*") == 1); - CHECK(Str_Match("Long string", "Lo*ng") == 1); - CHECK(Str_Match("Long string", "Lo*ng ") == 0); - CHECK(Str_Match("Long string", "Lo*ng *") == 1); - CHECK(Str_Match("string", "stri?g") == 1); - CHECK(Str_Match("str?ng", "str\\?ng") == 1); - CHECK(Str_Match("striiiing", "str?*ng") == 1); - CHECK(Str_Match("Very long string just to see", "******a****") == 0); - CHECK(Str_Match("d[abc?", "d\\[abc\\?") == 1); - CHECK(Str_Match("d[abc!", "d\\[abc\\?") == 0); - CHECK(Str_Match("dwabc?", "d\\[abc\\?") == 0); - CHECK(Str_Match("da0", "d[bcda]0") == 1); - CHECK(Str_Match("da0", "d[z-a]0") == 1); - CHECK(Str_Match("d-0", "d[-a-z]0") == 1); - CHECK(Str_Match("dy0", "d[a\\-z]0") == 0); - CHECK(Str_Match("d-0", "d[a\\-z]0") == 1); - CHECK(Str_Match("dz0", "d[a\\]z]0") == 1); + CHECK(Str_Match("string", "string") == TRUE); + CHECK(Str_Match("string", "string2") == FALSE); + CHECK(Str_Match("string", "string*") == TRUE); + CHECK(Str_Match("Long string", "Lo*ng") == TRUE); + CHECK(Str_Match("Long string", "Lo*ng ") == FALSE); + CHECK(Str_Match("Long string", "Lo*ng *") == TRUE); + CHECK(Str_Match("string", "stri?g") == TRUE); + CHECK(Str_Match("str?ng", "str\\?ng") == TRUE); + CHECK(Str_Match("striiiing", "str?*ng") == TRUE); + CHECK(Str_Match("Very long string just to see", "******a****") == FALSE); + CHECK(Str_Match("d[abc?", "d\\[abc\\?") == TRUE); + CHECK(Str_Match("d[abc!", "d\\[abc\\?") == FALSE); + CHECK(Str_Match("dwabc?", "d\\[abc\\?") == FALSE); + CHECK(Str_Match("da0", "d[bcda]0") == TRUE); + CHECK(Str_Match("da0", "d[z-a]0") == TRUE); + CHECK(Str_Match("d-0", "d[-a-z]0") == TRUE); + CHECK(Str_Match("dy0", "d[a\\-z]0") == FALSE); + CHECK(Str_Match("d-0", "d[a\\-z]0") == TRUE); + CHECK(Str_Match("dz0", "d[a\\]z]0") == TRUE); if (errors != 0) printf("Errors: %d\n", errors); |