cmd/upgrade: fix output regex in test
The "upgrades with asking for user prompts with dependants checks" test for `cmd/upgrade` has been failing on CI. The regex in the test doesn't match expected output because the negative lookaheads aren't working as expected. The intention is to make sure that the names aren't repeated (i.e., second shouldn't match first, third shouldn't match first or second) but the negative lookaheads should be _inside_ the second/third capture group for this to work as intended. This updated regex should work as expected. I manually tested it using the output from CI to make sure that it matches when no formula names are repeated (e.g., `Formulae (3): testball, testball4, testball5`) and does not match if formula names are repeated (e.g., `Formulae (3): testball5, testball4, testball5`).
This commit is contained in:
parent
35897fe49c
commit
7b2d84337e
@ -54,19 +54,11 @@ RSpec.describe Homebrew::Cmd::UpgradeCmd do
|
|||||||
|
|
||||||
regex = /
|
regex = /
|
||||||
Formulae\s*\(3\):\s*
|
Formulae\s*\(3\):\s*
|
||||||
(
|
(testball|testball5|testball4)
|
||||||
testball|testball5|testball4
|
|
||||||
)
|
|
||||||
\s*,\s*
|
\s*,\s*
|
||||||
(?!\1)
|
((?!\1)testball|testball5|testball4)
|
||||||
(
|
|
||||||
testball|testball5|testball4
|
|
||||||
)
|
|
||||||
\s*,\s*
|
\s*,\s*
|
||||||
(?!\1|\2)
|
((?!\1|\2)testball|testball5|testball4)
|
||||||
(
|
|
||||||
testball|testball5|testball4
|
|
||||||
)
|
|
||||||
/x
|
/x
|
||||||
expect do
|
expect do
|
||||||
brew "upgrade", "--ask"
|
brew "upgrade", "--ask"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user