8 static const char *expected
[N
] =
10 str
, "c", "i", "", "", "", "", "", "", ""
17 static const char pat
[] = "\
18 ^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$";
20 int err
= regcomp (&rbuf
, pat
, REG_EXTENDED
);
24 regerror (err
, &rbuf
, errstr
, sizeof (errstr
));
30 err
= regexec (&rbuf
, str
, N
, m
, 0);
33 puts ("regexec failed");
38 for (int i
= 0; i
< N
; ++i
)
41 printf ("m[%d] unused\n", i
);
46 int len
= m
[i
].rm_eo
- m
[i
].rm_so
;
48 printf ("m[%d] = \"%.*s\"\n", i
, len
, str
+ m
[i
].rm_so
);
50 if (strlen (expected
[i
]) != len
51 || memcmp (expected
[i
], str
+ m
[i
].rm_so
, len
) != 0)
59 #define TEST_FUNCTION do_test ()
60 #include "../test-skeleton.c"