From: Bartosz Golaszewski Date: Tue, 7 Feb 2023 21:13:57 +0000 (+0100) Subject: tests: extend the regex matching string versions X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=265124bae0326333cf1bd0b90494a3a8414f4c1e;p=qemu-gpiodev%2Flibgpiod.git tests: extend the regex matching string versions We need to match release candidate versions too. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/tests/tests-misc.cpp b/bindings/cxx/tests/tests-misc.cpp index 0a2c563..55f2232 100644 --- a/bindings/cxx/tests/tests-misc.cpp +++ b/bindings/cxx/tests/tests-misc.cpp @@ -71,7 +71,7 @@ TEST_CASE("api_version() returns a valid API version", "[misc]") SECTION("check api_version() format") { REQUIRE_THAT(::gpiod::api_version(), - regex_matcher("^[0-9][1-9]?\\.[0-9][1-9]?([\\.0-9]?|\\-devel)$")); + regex_matcher("^[0-9][1-9]?\\.[0-9][1-9]?([\\.0-9]?|\\-devel|\\-rc[0-9])$")); } } diff --git a/bindings/python/tests/tests_module.py b/bindings/python/tests/tests_module.py index de56356..d4c90e2 100644 --- a/bindings/python/tests/tests_module.py +++ b/bindings/python/tests/tests_module.py @@ -51,7 +51,7 @@ class IsGPIOChip(TestCase): class VersionString(TestCase): - VERSION_PATTERN = "^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel)$" + VERSION_PATTERN = "^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$" def test_api_version_string(self): self.assertRegex(gpiod.api_version, VersionString.VERSION_PATTERN) diff --git a/tests/tests-misc.c b/tests/tests-misc.c index 45b92f6..fa8deca 100644 --- a/tests/tests-misc.c +++ b/tests/tests-misc.c @@ -67,7 +67,7 @@ GPIOD_TEST_CASE(is_gpiochip_null_path) GPIOD_TEST_CASE(version_string) { - static const gchar *const pattern = "^[0-9][1-9]?\\.[0-9][1-9]?([\\.0-9]?|\\-devel)$"; + static const gchar *const pattern = "^[0-9][1-9]?\\.[0-9][1-9]?([\\.0-9]?|\\-devel|\\-rc[0-9])$"; g_autoptr(GError) err = NULL; g_autoptr(GRegex) regex = NULL;