diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/PTESTS | 30 | ||||
-rw-r--r-- | posix/TESTS | 2 | ||||
-rw-r--r-- | posix/runptests.c | 10 | ||||
-rw-r--r-- | posix/runtests.c | 13 |
4 files changed, 33 insertions, 22 deletions
diff --git a/posix/PTESTS b/posix/PTESTS index 198456f..cc626fa 100644 --- a/posix/PTESTS +++ b/posix/PTESTS @@ -42,11 +42,11 @@ -1¦-1¦\(^*ab\)¦^*ab¦ -1¦-1¦\(^*b\)¦a*b¦ -1¦-1¦\(^*b\)¦^*b¦ -# GA113(2) --1¦-1¦\(^*ab\)¦*ab¦ --1¦-1¦\(^*ab\)¦^*ab¦ -1¦1¦\(^*b\)¦b¦ -1¦3¦\(^*b\)¦^^b¦ +### GA113(2) GNU regex implements GA113(1) +##-1¦-1¦\(^*ab\)¦*ab¦ +##-1¦-1¦\(^*ab\)¦^*ab¦ +##1¦1¦\(^*b\)¦b¦ +##1¦3¦\(^*b\)¦^^b¦ # GA114 1¦3¦a^b¦a^b¦ 1¦3¦a\^b¦a^b¦ @@ -275,11 +275,11 @@ 1¦1¦\(^^\)¦^^¦ 1¦3¦\(^abc\)¦abcdef¦ -1¦-1¦\(^def\)¦abcdef¦ -# GA145(2) --1¦-1¦\(^a\)\1¦aabc¦ -1¦4¦\(^a\)\1¦^a^abc¦ --1¦-1¦\(^^a\)¦^a¦ -1¦2¦\(^^\)¦^^¦ +### GA145(2) GNU regex implements GA145(1) +##-1¦-1¦\(^a\)\1¦aabc¦ +##1¦4¦\(^a\)\1¦^a^abc¦ +##-1¦-1¦\(^^a\)¦^a¦ +##1¦2¦\(^^\)¦^^¦ # GA146 3¦3¦a$¦cba¦ -1¦-1¦a$¦abc¦ @@ -295,11 +295,11 @@ 1¦2¦\(ab$\)¦ab¦ 4¦6¦\(def$\)¦abcdef¦ -1¦-1¦\(abc$\)¦abcdef¦ -# GA147(2) --1¦-1¦\(a$\)\1¦bcaa¦ -2¦5¦\(a$\)\1¦ba$a$¦ --1¦-1¦\(ab$\)¦ab¦ -1¦3¦\(ab$\)¦ab$¦ +### GA147(2) GNU regex implements GA147(1) +##-1¦-1¦\(a$\)\1¦bcaa¦ +##2¦5¦\(a$\)\1¦ba$a$¦ +##-1¦-1¦\(ab$\)¦ab¦ +##1¦3¦\(ab$\)¦ab$¦ # GA148 0¦0¦^$¦¦ 1¦3¦^abc$¦abc¦ diff --git a/posix/TESTS b/posix/TESTS index 4f1c49f..858e223 100644 --- a/posix/TESTS +++ b/posix/TESTS @@ -39,7 +39,7 @@ 0:a[b-d]:aac 0:a[-b]:a- 0:a[b-]:a- -1:a[b-a]:- +2:a[b-a]:- 2:a[]b:- 2:a[:- 0:a]:a] diff --git a/posix/runptests.c b/posix/runptests.c index b1eabb9..fcea5b3 100644 --- a/posix/runptests.c +++ b/posix/runptests.c @@ -63,8 +63,8 @@ main (int argc, char *argv[]) err = regcomp (&re, tests[cnt].reg, tests[cnt].options); if (err != 0) { - if (tests[cnt].start == -1) - puts ("failed, OK"); + if (tests[cnt].start == -2) + puts ("compiling failed, OK"); else { char buf[100]; @@ -75,6 +75,12 @@ main (int argc, char *argv[]) continue; } + else if (tests[cnt].start == -2) + { + puts ("compiling suceeds, FAIL"); + errors++; + continue; + } /* Run the actual test. */ err = regexec (&re, tests[cnt].str, 20, match, 0); diff --git a/posix/runtests.c b/posix/runtests.c index b6a292e..8347286 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); } |