# # patch "ChangeLog" # from [c8303458537beb7469d6519dc3edd76e3042a631] # to [b57d4b015d6ffddfe2337eb0da523c6e604f4887] # # patch "globish.cc" # from [b7a8692bb87c831048f22d0a262e2aacf02cda0b] # to [989f71f06fc4a19a71280d3459e836dbc4be3b89] # =============================================== --- ChangeLog c8303458537beb7469d6519dc3edd76e3042a631 +++ ChangeLog b57d4b015d6ffddfe2337eb0da523c6e604f4887 @@ -1,5 +1,10 @@ 2005-07-29 Nathaniel Smith
+ * globish.cc (matcher::operator()): Log what's happening. + (checked_globish_to_regex_test): Fix previously added test. + +2005-07-29 Nathaniel Smith + * globish.cc (checked_globish_to_regex_test): Add another test for quoted characters. =============================================== --- globish.cc b7a8692bb87c831048f22d0a262e2aacf02cda0b +++ globish.cc 989f71f06fc4a19a71280d3459e836dbc4be3b89 @@ -135,7 +135,15 @@ { // regex_match may throw a std::runtime_error, if the regex turns out to be // really pathological - return boost::regex_match(s, r_inc) && !boost::regex_match(s, r_exc); + bool inc_match = boost::regex_match(s, r_inc); + bool exc_match = boost::regex_match(s, r_exc); + bool result = inc_match && !exc_match; + L(F("matching '%s' against '%s' excluding '%s': %s, %s: %s\n") + % s % r_inc % r_exc + % (inc_match ? "included" : "not included") + % (exc_match ? "excluded" : "not excluded") + % (result ? "matches" : "does not match")); + return result; } #ifdef BUILD_UNIT_TESTS @@ -163,7 +171,7 @@ // non-alphanumerics, hence the backslash BOOST_CHECK(pat == "\\,"); checked_globish_to_regex("\\.\\+\\$\\^\\(\\)", pat); - BOOST_CHECK(pat == "\\.\\+\\$\\^()"); + BOOST_CHECK(pat == "\\.\\+\\$\\^\\(\\)"); BOOST_CHECK_THROW(checked_globish_to_regex("foo\\", pat), informative_failure); BOOST_CHECK_THROW(checked_globish_to_regex("{foo", pat), informative_failure);