Skip to content

Commit ffbfe4c

Browse files
jet-logicjet-logic
authored andcommitted
winci68
1 parent 4dabb6c commit ffbfe4c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def test_split(self):
3434
"-c"
3535
'from sys import stderr, stdout; stdout.write("123"); stderr.write("456")',
3636
)
37-
m = re.search(r"(?mx) \W+ Started: \W+ [^\)]+ \s+ \( [^\)]+ \) \s+ (.+)", o)
37+
m = re.search(
38+
r"(?mx) (?:\W+|\A) Started: \W+ [^\)]+ \s+ \( [^\)]+ \) \s+ (.+)", o
39+
)
3840
self.assertTrue(m)
3941
n = m.group(1)
4042
self.assertTrue(n)
@@ -80,7 +82,9 @@ def test_kill(self):
8082
print("check_pid", pid)
8183
sleep(1)
8284
o = self.run_runce("kill", "carrot")
83-
self.assertRegex(o, r"(?xim) \W+ no \W+ process \W+ .+ \W+ carrot (\W+|\Z)")
85+
self.assertRegex(
86+
o, r"(?xim) (?:\W+|\A) no \W+ process \W+ .+ \W+ carrot (\W+|\Z)"
87+
)
8488
o = self.run_runce("clean", "carrot")
8589

8690
def test_tail(self):
@@ -93,7 +97,7 @@ def test_tail(self):
9397
"-c",
9498
"for x in 'ABCD EFGH IJKL MNOP QRST UVWX YZ'.split(): print(x)",
9599
)
96-
self.assertRegex(o, r"(?xim) \W+ started: \W+ .+ \W+ tomato \W+")
100+
self.assertRegex(o, r"(?xim) (?:\W+|\A) started: \W+ .+ \W+ tomato \W+")
97101
sleep(1)
98102
o = self.run_runce("tail", "-n", "3", "--header", "no", "tomato")
99103
self.assertRegex(o, r"(?xim) QRST \W+ UVWX \W+ YZ \W+ \Z")

0 commit comments

Comments
 (0)