7 static const char *expected
[N
] =
9 str
, "c", "i", "", "", "", "", "", "", ""
16 static const char pat
[] = "\
17 ^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$";
19 int err
= regcomp (&rbuf
, pat
, REG_EXTENDED
);
23 regerror (err
, &rbuf
, errstr
, sizeof (errstr
));
29 err
= regexec (&rbuf
, str
, N
, m
, 0);
32 puts ("regexec failed");
37 for (int i
= 0; i
< N
; ++i
)
40 printf ("m[%d] unused\n", i
);
45 int len
= m
[i
].rm_eo
- m
[i
].rm_so
;
47 printf ("m[%d] = \"%.*s\"\n", i
, len
, str
+ m
[i
].rm_so
);
49 if (strlen (expected
[i
]) != len
50 || memcmp (expected
[i
], str
+ m
[i
].rm_so
, len
) != 0)
58 #define TEST_FUNCTION do_test ()
59 #include "../test-skeleton.c"