From 9fe0be871c916c1105212f916d8c6904d12ea5b4 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 2 May 2018 13:53:43 +0100 Subject: [PATCH] unit-test/matcher_t: Fixup Kabi's test The matcher matches the regexes in reverse order. --- test/unit/matcher_t.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/unit/matcher_t.c b/test/unit/matcher_t.c index b5bf1cfc2..31109d248 100644 --- a/test/unit/matcher_t.c +++ b/test/unit/matcher_t.c @@ -74,18 +74,20 @@ static void test_matching(void *fixture) static void test_kabi_query(void *fixture) { + // Remember, matches regexes from last to first. static const char *_patterns[] = { - "loop", "/dev/md.*", ".*" + ".*", ".*/dev/md.*", "loop" }; static struct { const char *input; int r; } _cases[] = { - {"foo", 2}, - {"/dev/mapper/vg-lvol1", 2}, - {"/dev/mapper/vglvol1", 2}, - {"loop", 0}, + {"foo", 0}, + {"/dev/mapper/vg-lvol1", 0}, + {"/dev/mapper/vglvol1", 0}, + {"/dev/md1", 1}, + {"loop", 2}, }; int r;