From e4f0f470eeeefdda0848602bca90f6bc5f4786ca Mon Sep 17 00:00:00 2001
From: wwwil <wwwil.squires@gmail.com>
Date: Tue, 4 Jun 2019 11:38:17 +0100
Subject: [PATCH] Add regex op to test

---
 check/test.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/check/test.go b/check/test.go
index d27750a..b15cb8b 100644
--- a/check/test.go
+++ b/check/test.go
@@ -185,6 +185,11 @@ func (t *testItem) execute(s string) *testOutput {
 			case "nothave":
 				expectedResultPattern = " '%s' not have '%s'"
 				result.testResult = !strings.Contains(flagVal, t.Compare.Value)
+
+			case "regex":
+				expectedResultPattern = " '%s' matched by '%s'"
+				opRe := regexp.MustCompile(t.Compare.Value)
+				result.testResult = opRe.MatchString(flagVal)
 			}
 
 			result.ExpectedResult = fmt.Sprintf(expectedResultPattern, t.Flag, t.Compare.Value)
-- 
GitLab