Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 56c2fa6

Browse files
committedApr 10, 2025
e2e/cli-plugins: use regexp.Compile to prevent panic in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 1ed3859 commit 56c2fa6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎e2e/cli-plugins/help_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ func TestGlobalHelp(t *testing.T) {
4242
`Invalid Plugins:`,
4343
`\s+badmeta\s+invalid metadata: invalid character 'i' looking for beginning of object key string`,
4444
} {
45-
expected := regexp.MustCompile(`(?m)^` + s + `$`)
45+
expected, err := regexp.Compile(`(?m)^` + s + `$`)
46+
assert.NilError(t, err)
4647
matches := expected.FindAllString(output, -1)
4748
assert.Equal(t, len(matches), 1, "Did not find expected number of matches for %q in `docker help` output", expected)
4849
}

0 commit comments

Comments
 (0)
Failed to load comments.