Merge pull request #626 from andlaus/better_regex_test
make the regex test more thorough
This commit is contained in:
@@ -133,19 +133,23 @@ CHECK_CXX_SOURCE_RUNS("
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
std::regex r(\"AB.*|BC+\", std::regex::extended);
|
std::regex r(\"AB.*|BC+|DE.+\", std::regex::extended);
|
||||||
if (!std::regex_match(\"AB\", r))
|
if (!std::regex_match(\"AB\", r))
|
||||||
return 1;
|
return 1;
|
||||||
if (!std::regex_match(\"ABC\", r))
|
if (!std::regex_match(\"ABC\", r))
|
||||||
return 1;
|
return 2;
|
||||||
if (!std::regex_match(\"ABC!#\", r))
|
if (!std::regex_match(\"ABC!#\", r))
|
||||||
return 1;
|
return 3;
|
||||||
if (std::regex_match(\"B\", r))
|
if (std::regex_match(\"B\", r))
|
||||||
return 1;
|
return 4;
|
||||||
if (!std::regex_match(\"BC\", r))
|
if (!std::regex_match(\"BC\", r))
|
||||||
return 1;
|
return 5;
|
||||||
if (std::regex_match(\"BCE\", r))
|
if (std::regex_match(\"BCE\", r))
|
||||||
return 1;
|
return 6;
|
||||||
|
if (std::regex_match(\"DE\", r))
|
||||||
|
return 7;
|
||||||
|
if (!std::regex_match(\"DEF\", r))
|
||||||
|
return 8;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
" HAVE_REGEX
|
" HAVE_REGEX
|
||||||
|
|||||||
Reference in New Issue
Block a user