lib: improve test coverage

Add a bunch of tests
This commit is contained in:
Dirk-Jan C. Binnema
2022-06-02 21:02:11 +03:00
parent 63521300a3
commit 13f0e24241
12 changed files with 275 additions and 54 deletions

View File

@ -531,7 +531,8 @@ Mu::parse_size(const std::string& val, bool is_first)
if (val.empty())
return is_first ? 0 : std::numeric_limits<int64_t>::max();
rx = g_regex_new("(\\d+)(b|k|kb|m|mb|g|gb)?", G_REGEX_CASELESS, (GRegexMatchFlags)0, NULL);
rx = g_regex_new("^(\\d+)(b|k|kb|m|mb|g|gb)?$",
G_REGEX_CASELESS, (GRegexMatchFlags)0, NULL);
minfo = NULL;
if (g_regex_match(rx, val.c_str(), (GRegexMatchFlags)0, &minfo)) {