From ffa24bf56ed538ef27e65ff2322b576b3f7274f5 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 12 Oct 2020 18:53:54 -0700 Subject: [PATCH] SedRegex: add a no match test case --- plugins/SedRegex/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/SedRegex/test.py b/plugins/SedRegex/test.py index 0c70f8f31..296352062 100644 --- a/plugins/SedRegex/test.py +++ b/plugins/SedRegex/test.py @@ -51,6 +51,15 @@ class SedRegexTestCase(ChannelPluginTestCase): m = self.getMsg(' ') self.assertIn('Abcd testefgh', str(m)) + def testNoMatch(self): + self.feedMsg('hello world') + self.feedMsg('s/goodbye//') + m = self.getMsg(' ') + self.assertIn('Search not found', str(m)) + self.feedMsg('s/Hello/hi/') # wrong case + m = self.getMsg(' ') + self.assertIn('Search not found', str(m)) + def testCaseInsensitiveReplace(self): self.feedMsg('Aliens Are Invading, Help!') self.feedMsg('s/a/e/i')