mirror of
https://github.com/containers/podman.git
synced 2025-12-02 19:28:58 +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
|
package e2e_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"regexp"
|
|
||||||
"slices"
|
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
. "github.com/onsi/gomega/gexec"
|
. "github.com/onsi/gomega/gexec"
|
||||||
@@ -16,8 +13,6 @@ var _ = Describe("podman help", func() {
|
|||||||
Expect(helpSession).Should(Exit(0))
|
Expect(helpSession).Should(Exit(0))
|
||||||
|
|
||||||
// Verify `.exe` suffix doesn't present in the usage command string
|
// Verify `.exe` suffix doesn't present in the usage command string
|
||||||
helpMessages := helpSession.outputToStringSlice()
|
Expect(helpSession.outputToString()).ToNot(ContainSubstring(".exe"))
|
||||||
usageCmdIndex := slices.IndexFunc(helpMessages, func(helpMessage string) bool { return helpMessage == "Usage:" }) + 1
|
|
||||||
Expect(regexp.MustCompile(`\w\.exe\b`).MatchString(helpMessages[usageCmdIndex])).Should(BeFalse())
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user