# # # patch "globish.cc" # from [a25133bce26322aa0151d7e6420db17833283761] # to [a35e1424d01f6bbfe17635ea92276655f96334e1] # ============================================================ --- globish.cc a25133bce26322aa0151d7e6420db17833283761 +++ globish.cc a35e1424d01f6bbfe17635ea92276655f96334e1 @@ -334,6 +334,7 @@ find_next_subpattern(string::const_itera string::const_iterator pe, bool want_alternatives) { + L(FL("Finding subpattern in '%s'") % decode(p, pe)); unsigned int depth = 1; for (; p != pe; p++) switch (*p) @@ -705,6 +706,19 @@ UNIT_TEST(globish, complex_matches) } } +UNIT_TEST(globish, nested_matches) +{ + globish g("a.{i.{x,y},j}"); + UNIT_TEST_CHECK(g.matches("a.i.x")); + UNIT_TEST_CHECK(g.matches("a.i.y")); + UNIT_TEST_CHECK(g.matches("a.j")); + UNIT_TEST_CHECK(!g.matches("q")); + UNIT_TEST_CHECK(!g.matches("a.q")); + UNIT_TEST_CHECK(!g.matches("a.j.q")); + UNIT_TEST_CHECK(!g.matches("a.i.q")); + UNIT_TEST_CHECK(!g.matches("a.i.x.q")); +} + #endif // BUILD_UNIT_TESTS // Local Variables: