mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
pkg/machine/e2e: improve podman.exe match
The regex match would return a horrible error message and is way more complicated then it should be. Simply check that .exe is not part of the output. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
package e2e_test
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"slices"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
. "github.com/onsi/gomega/gexec"
|
||||
@@ -16,8 +13,6 @@ var _ = Describe("podman help", func() {
|
||||
Expect(helpSession).Should(Exit(0))
|
||||
|
||||
// Verify `.exe` suffix doesn't present in the usage command string
|
||||
helpMessages := helpSession.outputToStringSlice()
|
||||
usageCmdIndex := slices.IndexFunc(helpMessages, func(helpMessage string) bool { return helpMessage == "Usage:" }) + 1
|
||||
Expect(regexp.MustCompile(`\w\.exe\b`).MatchString(helpMessages[usageCmdIndex])).Should(BeFalse())
|
||||
Expect(helpSession.outputToString()).ToNot(ContainSubstring(".exe"))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user