Merge pull request #4110

639ca3b core_tests: add --filter to select which tests to run (moneromooo-monero)
This commit is contained in:
luigi1111 2018-07-27 14:28:49 -05:00
commit ff01c3ade4
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
5 changed files with 29 additions and 20 deletions

View file

@ -919,4 +919,23 @@ std::string get_nix_version_display_string()
return {};
}
}
std::string glob_to_regex(const std::string &val)
{
std::string newval;
bool escape = false;
for (char c: val)
{
if (c == '*')
newval += escape ? "*" : ".*";
else if (c == '?')
newval += escape ? "?" : ".";
else if (c == '\\')
newval += '\\', escape = !escape;
else
newval += c;
}
return newval;
}
}

View file

@ -231,4 +231,6 @@ namespace tools
bool is_hdd(const char *path);
boost::optional<std::pair<uint32_t, uint32_t>> parse_subaddress_lookahead(const std::string& str);
std::string glob_to_regex(const std::string &val);
}