diff options
Diffstat (limited to 'posix/runtests.c')
-rw-r--r-- | posix/runtests.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/posix/runtests.c b/posix/runtests.c index b6a292e6f5..8347286989 100644 --- a/posix/runtests.c +++ b/posix/runtests.c @@ -65,7 +65,7 @@ run_a_test (int id, const struct a_test * t) err = regcomp (&r, t->pattern, REG_EXTENDED); if (err) { - if (t->expected) + if (t->expected == 2) { puts (" OK."); return 0; @@ -75,6 +75,13 @@ run_a_test (int id, const struct a_test * t) puts (errmsg); return 1; } + else if (t->expected == 2) + { + printf ("test %d\n", id); + printf ("pattern \"%s\" successfull compilation not expected\n", + t->pattern); + return 1; + } } err = regexec (&r, t->data, 10, regs, 0); @@ -124,9 +131,7 @@ main (int argc, char * argv[]) printf ("#%d:", x); res |= run_a_test (x, &the_tests[x]); } - { - exit (0); - } + exit (res != 0); } |