It seems like every release there's some new problem with parsing the
version strings in tests. Let's reduce the strictness of the patterns
to avoid future test failures and accept the following version schemes:
X.Y
X.Y.Z
X.Y-devel
X.Y-rcZ
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
SECTION("check api_version() format")
{
REQUIRE_THAT(::gpiod::api_version(),
- regex_matcher("^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$"));
+ regex_matcher("^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)$"));
}
}
class VersionString(TestCase):
- VERSION_PATTERN = "^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$"
+ VERSION_PATTERN = "^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)$"
def test_api_version_string(self):
self.assertRegex(gpiod.api_version, VersionString.VERSION_PATTERN)
GPIOD_TEST_CASE(version_string)
{
- static const gchar *const pattern = "^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$";
+ static const gchar *const pattern = "^\\d+\\.\\d+(\\.\\d+|\\-devel|\\-rc\\d+)$";
g_autoptr(GError) err = NULL;
g_autoptr(GRegex) regex = NULL;