On Fri, Dec 06, 2013 at 06:10:55AM -0800, Steve Beattie wrote:
> > I think one more case would be useful, to check that /**/ works as
> > expected:
> >
> > MY_REGEX_TEST("/**/", "/[^/\\x00][^\\x00]*/", ePatternTailGlob);
> >
> > Does that look right?
>
> Correct except for the type returned, which will be ePatternRegex if I'm
> not mistaken.Copy-and-waste for the win. > And, I think tests for both /*/ and /**/ would be useful. So here's a > patch: > > Signed-off-by: Steve Beattie <[email protected]> Acked-by: Seth Arnold <[email protected]> Thanks! > --- > parser/parser_regex.c | 2 ++ > 1 file changed, 2 insertions(+) > > Index: b/parser/parser_regex.c > =================================================================== > --- a/parser/parser_regex.c > +++ b/parser/parser_regex.c > @@ -1390,9 +1390,11 @@ static int test_aaregex_to_pcre(void) > MY_REGEX_TEST("/*", "/[^/\\x00][^/\\x00]*", ePatternRegex); > MY_REGEX_TEST("/blort/*", "/blort/[^/\\x00][^/\\x00]*", ePatternRegex); > MY_REGEX_TEST("/*/blort", "/[^/\\x00][^/\\x00]*/blort", ePatternRegex); > + MY_REGEX_TEST("/*/", "/[^/\\x00][^/\\x00]*/", ePatternRegex); > MY_REGEX_TEST("/**", "/[^/\\x00][^\\x00]*", ePatternTailGlob); > MY_REGEX_TEST("/blort/**", "/blort/[^/\\x00][^\\x00]*", > ePatternTailGlob); > MY_REGEX_TEST("/**/blort", "/[^/\\x00][^\\x00]*/blort", ePatternRegex); > + MY_REGEX_TEST("/**/", "/[^/\\x00][^\\x00]*/", ePatternRegex); > > /* more complicated quoting */ > MY_REGEX_FAIL_TEST("\\\\["); >
signature.asc
Description: Digital signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
