forked from boostorg/regex
Updated History.
Added additional tests for regexes that are supposed to be empty. Added additional test cases for non-greedy repeats. [SVN r30605]
This commit is contained in:
@ -24,6 +24,25 @@
|
|||||||
</P>
|
</P>
|
||||||
<HR>
|
<HR>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
<P>Boost 1.33.0 Hotfix</P>
|
||||||
|
<UL>
|
||||||
|
<LI>
|
||||||
|
Fixed broken makefiles.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed configuration setup to allow building with VC7.1 - STLport-4.6.2 when
|
||||||
|
using /Zc:wchar_t.</LI>
|
||||||
|
<LI>
|
||||||
|
Moved declarations class-inline in static_mutex.hpp so that SGI Irix compiler
|
||||||
|
can cope.</LI>
|
||||||
|
<LI>
|
||||||
|
Added missing #includes to fileiter.hpp and cpp_regex_traits.hpp, this is
|
||||||
|
probably an SGI Irix specific fix.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed a bug where non-greedy repeats could in certain strange curcumstances
|
||||||
|
repeat more times than their maximum value.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed the value returned by basic_regex<>::empty() from a default
|
||||||
|
constructed object.</LI></UL>
|
||||||
<P>Boost 1.33.0.</P>
|
<P>Boost 1.33.0.</P>
|
||||||
<UL>
|
<UL>
|
||||||
<LI>
|
<LI>
|
||||||
|
@ -24,6 +24,25 @@
|
|||||||
</P>
|
</P>
|
||||||
<HR>
|
<HR>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
<P>Boost 1.33.0 Hotfix</P>
|
||||||
|
<UL>
|
||||||
|
<LI>
|
||||||
|
Fixed broken makefiles.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed configuration setup to allow building with VC7.1 - STLport-4.6.2 when
|
||||||
|
using /Zc:wchar_t.</LI>
|
||||||
|
<LI>
|
||||||
|
Moved declarations class-inline in static_mutex.hpp so that SGI Irix compiler
|
||||||
|
can cope.</LI>
|
||||||
|
<LI>
|
||||||
|
Added missing #includes to fileiter.hpp and cpp_regex_traits.hpp, this is
|
||||||
|
probably an SGI Irix specific fix.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed a bug where non-greedy repeats could in certain strange curcumstances
|
||||||
|
repeat more times than their maximum value.</LI>
|
||||||
|
<LI>
|
||||||
|
Fixed the value returned by basic_regex<>::empty() from a default
|
||||||
|
constructed object.</LI></UL>
|
||||||
<P>Boost 1.33.0.</P>
|
<P>Boost 1.33.0.</P>
|
||||||
<UL>
|
<UL>
|
||||||
<LI>
|
<LI>
|
||||||
|
@ -60,6 +60,12 @@ void do_test(const charT& c, const tagT& tag)
|
|||||||
#ifndef BOOST_NO_STD_LOCALE
|
#ifndef BOOST_NO_STD_LOCALE
|
||||||
test_info<charT>::set_typename(typeid(boost::basic_regex<charT, boost::cpp_regex_traits<charT> >).name());
|
test_info<charT>::set_typename(typeid(boost::basic_regex<charT, boost::cpp_regex_traits<charT> >).name());
|
||||||
boost::basic_regex<charT, boost::cpp_regex_traits<charT> > e1;
|
boost::basic_regex<charT, boost::cpp_regex_traits<charT> > e1;
|
||||||
|
static bool done_empty_test = false;
|
||||||
|
if(done_empty_test == false)
|
||||||
|
{
|
||||||
|
test_empty(e1);
|
||||||
|
done_empty_test = true;
|
||||||
|
}
|
||||||
if(test_locale::cpp_locale_state() == test_locale::test_with_locale)
|
if(test_locale::cpp_locale_state() == test_locale::test_with_locale)
|
||||||
e1.imbue(test_locale::cpp_locale());
|
e1.imbue(test_locale::cpp_locale());
|
||||||
if(test_locale::cpp_locale_state() != test_locale::no_test)
|
if(test_locale::cpp_locale_state() != test_locale::no_test)
|
||||||
|
@ -25,6 +25,31 @@
|
|||||||
//
|
//
|
||||||
struct test_invalid_regex_tag{};
|
struct test_invalid_regex_tag{};
|
||||||
|
|
||||||
|
template<class charT, class traits>
|
||||||
|
void test_empty(boost::basic_regex<charT, traits>& r)
|
||||||
|
{
|
||||||
|
if(!r.empty())
|
||||||
|
{
|
||||||
|
BOOST_REGEX_TEST_ERROR("Invalid value returned from basic_regex<>::empty().", charT);
|
||||||
|
}
|
||||||
|
if(r.size())
|
||||||
|
{
|
||||||
|
BOOST_REGEX_TEST_ERROR("Invalid value returned from basic_regex<>::size().", charT);
|
||||||
|
}
|
||||||
|
if(r.str().size())
|
||||||
|
{
|
||||||
|
BOOST_REGEX_TEST_ERROR("Invalid value returned from basic_regex<>::str().", charT);
|
||||||
|
}
|
||||||
|
if(r.begin() != r.end())
|
||||||
|
{
|
||||||
|
BOOST_REGEX_TEST_ERROR("Invalid value returned from basic_regex<>::begin().", charT);
|
||||||
|
}
|
||||||
|
if(r.status() == 0)
|
||||||
|
{
|
||||||
|
BOOST_REGEX_TEST_ERROR("Invalid value returned from basic_regex<>::status().", charT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
void test(boost::basic_regex<charT, traits>& r, const test_invalid_regex_tag&)
|
void test(boost::basic_regex<charT, traits>& r, const test_invalid_regex_tag&)
|
||||||
{
|
{
|
||||||
@ -39,6 +64,7 @@ void test(boost::basic_regex<charT, traits>& r, const test_invalid_regex_tag&)
|
|||||||
{
|
{
|
||||||
BOOST_REGEX_TEST_ERROR("Expression compiled when it should not have done so.", charT);
|
BOOST_REGEX_TEST_ERROR("Expression compiled when it should not have done so.", charT);
|
||||||
}
|
}
|
||||||
|
test_empty(r);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
@ -58,6 +84,7 @@ void test(boost::basic_regex<charT, traits>& r, const test_invalid_regex_tag&)
|
|||||||
catch(const boost::bad_expression&)
|
catch(const boost::bad_expression&)
|
||||||
{
|
{
|
||||||
have_catch = true;
|
have_catch = true;
|
||||||
|
test_empty(r);
|
||||||
}
|
}
|
||||||
catch(const std::runtime_error& r)
|
catch(const std::runtime_error& r)
|
||||||
{
|
{
|
||||||
|
@ -98,6 +98,20 @@ void test_simple_repeats()
|
|||||||
TEST_REGEX_SEARCH("a{ 2 , }", perl, "aaaaa", match_default, make_array(0, 5, -2, -2));
|
TEST_REGEX_SEARCH("a{ 2 , }", perl, "aaaaa", match_default, make_array(0, 5, -2, -2));
|
||||||
TEST_REGEX_SEARCH("a{ 2 }", perl, "aaa", match_default, make_array(0, 2, -2, -2));
|
TEST_REGEX_SEARCH("a{ 2 }", perl, "aaa", match_default, make_array(0, 2, -2, -2));
|
||||||
TEST_REGEX_SEARCH("a\\{\\}", perl, "a{}", match_default, make_array(0, 3, -2, -2));
|
TEST_REGEX_SEARCH("a\\{\\}", perl, "a{}", match_default, make_array(0, 3, -2, -2));
|
||||||
|
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?", perl, "a", match_default, make_array(-2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?", perl, "aa", match_default, make_array(0, 2, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?", perl, "aaa", match_default, make_array(0, 2, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?", perl, "aaaa", match_default, make_array(0, 2, -2, 2, 4, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?", perl, "aaaaa", match_default, make_array(0, 2, -2, 2, 4, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?$", perl, "aa", match_default, make_array(0, 2, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?$", perl, "aaa", match_default, make_array(0, 3, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?$", perl, "aaaa", match_default, make_array(0, 4, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("a{2,4}?$", perl, "aaaaa", match_default, make_array(1, 5, -2, -2));
|
||||||
|
TEST_REGEX_SEARCH("^a{0,1}?$", perl, "aaaaa", match_default, make_array(-2, -2));
|
||||||
|
TEST_REGEX_SEARCH("^(?:a){0,1}?$", perl, "aaaaa", match_default, make_array(-2, -2));
|
||||||
|
TEST_REGEX_SEARCH("^a(?:bc)?", perl, "abcbc", match_any|match_all, make_array(-2, -2));
|
||||||
|
|
||||||
TEST_INVALID_REGEX("a{}", perl);
|
TEST_INVALID_REGEX("a{}", perl);
|
||||||
TEST_INVALID_REGEX("a{", perl);
|
TEST_INVALID_REGEX("a{", perl);
|
||||||
TEST_INVALID_REGEX("a{1", perl);
|
TEST_INVALID_REGEX("a{1", perl);
|
||||||
|
Reference in New Issue
Block a user