All of lore.kernel.org
 help / color / mirror / Atom feed
* master - unit-test/matcher_t: Fixup Kabi's test
@ 2018-05-02 12:55 Joe Thornber
  0 siblings, 0 replies; only message in thread
From: Joe Thornber @ 2018-05-02 12:55 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9fe0be871c916c1105212f916d8c6904d12ea5b4
Commit:        9fe0be871c916c1105212f916d8c6904d12ea5b4
Parent:        506ab29bfd8ec5721cdabb0745ae29af739b47a4
Author:        Joe Thornber <ejt@redhat.com>
AuthorDate:    Wed May 2 13:53:43 2018 +0100
Committer:     Joe Thornber <ejt@redhat.com>
CommitterDate: Wed May 2 13:53:43 2018 +0100

unit-test/matcher_t: Fixup Kabi's test

The matcher matches the regexes in reverse order.
---
 test/unit/matcher_t.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/unit/matcher_t.c b/test/unit/matcher_t.c
index b5bf1cf..31109d2 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;



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-02 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 12:55 master - unit-test/matcher_t: Fixup Kabi's test Joe Thornber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.