From: Bartosz Golaszewski Date: Mon, 3 Feb 2020 10:19:07 +0000 (+0100) Subject: tests: misc: fix the version string test case X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f8700e0bde0b76cf76efc14a247937a222a219c;p=qemu-gpiodev%2Flibgpiod.git tests: misc: fix the version string test case The current development version is v1.6-devel. The '-' character is there to differentiate between the "main" version part and the extra suffix. The existing test case for the version string is now failing because we used '.' previously for the extra version suffix. Fix it by extending the regex pattern. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/tests-misc.c b/tests/tests-misc.c index e838b62..d077d49 100644 --- a/tests/tests-misc.c +++ b/tests/tests-misc.c @@ -22,7 +22,7 @@ GPIOD_TEST_CASE(version_string, 0, { 1 }) gpiod_test_return_if_failed(); g_assert_cmpuint(strlen(ver), >, 0); - regex = g_regex_new("^[0-9]+\\.[0-9]+[0-9a-zA-Z\\.]*$", 0, 0, &err); + regex = g_regex_new("^[0-9]+\\.[0-9]+[0-9a-zA-Z\\.-]*$", 0, 0, &err); g_assert_null(err); gpiod_test_return_if_failed(); g_assert_true(g_regex_match(regex, ver, 0, NULL));