The square bracket is in the wrong place which makes the regex not match
version strings of the form: x.y.z. Fix the pattern in core and bindings
tests.
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("^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$"));
}
}
class VersionString(TestCase):
- VERSION_PATTERN = "^[0-9][1-9]?\\.[0-9][1-9]?((\\.[0-9])?|\\-devel|\\-rc[0-9])$"
+ 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)
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 = "^[0-9][1-9]?\\.[0-9][1-9]?(\\.[0-9]?|\\-devel|\\-rc[0-9])$";
g_autoptr(GError) err = NULL;
g_autoptr(GRegex) regex = NULL;