File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ string normalizePath(const string& path)
265265 string s (path);
266266 static std::regex e0 (" /+" ); // Remove multiple / by single /
267267 s = std::regex_replace (s, e0 , " /" );
268- static std::regex e1 (" (/ \\ ./)+" ); // Remove multiple / by single /
268+ static std::regex e1 (" /( \\ ./)+" ); // Remove multiple / by single /
269269 s = std::regex_replace (s, e1 , " /" );
270270 return s;
271271}
Original file line number Diff line number Diff line change 88 */
99
1010#include " global.h"
11+ #include " ../utility/simple_assert.hpp"
1112
1213void test_normalize_path ()
1314{
1415 string p1 (" //a/./b" );
1516 auto p1fixes = moose::normalizePath (p1);
16- cout << p1 << " fixed " << p1fixes << endl;
17+ std::cout << p1 << " " << p1fixes << std::endl;
18+
19+ string p2 (" //a/./././///b" );
20+ auto p2fixes = moose::normalizePath (p2);
21+ std::cout << p2 << " " << p2fixes << std::endl;
22+ SIMPLE_ASSERT ( p2fixes == " /a/b" );
1723}
1824
1925int main (int argc, const char *argv[])
You can’t perform that action at this time.
0 commit comments