IncludeOS
IncludeOS copied to clipboard
test: path_to_regex_no_options.cpp:627 fails
Had to comment this one out.
"Paths with two parameters (or more of the first parameter) where the first contains one lower case letter and the second contains one or more integers should match"
std::regex r = path_to_regex("/:test([a-z])+/:id(\\d+)", keys);
EXPECT_NOT(std::regex_match("/M/1234", r));
There also seems to be some other tests that fails on jenkins(ubuntu), but not locally for me on mac: path_to_regex_no_options.cpp:734-736:
EXPECT(std::regex_match("/B", r)); // FAILS WHEN NOT CASE SENSITIVE (icase set)
EXPECT(std::regex_match("/Z", r)); // FAILS WHEN NOT CASE SENSITIVE (icase set)
EXPECT(std::regex_match("/Matilda", r)); // FAILS WHEN NOT CASE SENSITIVE (icase set)
# local
/Users/andreas/dev/IncludeOS/test/util/unit/path_to_regex_no_options.cpp:734: passed: Creating path_to_regex with no options: std::regex_match("/B", r) for true
# jenkins
/home/ubuntu/workspace/pull_request_misc/test/util/unit/path_to_regex_no_options.cpp:734: failed: Creating path_to_regex with no options: std::regex_match("/B", r) for false
1 out of 107 selected tests failed.
My compiler
$ /usr/bin/c++ -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
One more, line 895 (890fed1).
It looks like case insensitive /[a-z]
matches /A
but not /B
etc. Maybe @AnnikaH can explain the issue better.
Yes this is an issue we discussed some months ago and couldn't quite figure out - it's an issue with std::regex_constants::icase or our use of it - it doesn't do what it's supposed to (ignore case) in the code: https://github.com/includeos/path_to_regex/blob/master/path_to_regex.cpp#L203
Related? https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71500
Yes, looks very much like it. Nice find!