mirror of
https://github.com/containers/podman.git
synced 2026-03-29 20:14:05 -04:00
Signed-off-by: Leo Liu <silver886@users.noreply.github.com> Add comment In shell completion, there is `.exe` suffix on Windows and this does not provide same experience across platforms, #16499 Signed-off-by: Leo Liu <silver886@users.noreply.github.com> Create unit test for `.exe` suffix removal Signed-off-by: Leo Liu <11664880+silver886@users.noreply.github.com> Update comments Signed-off-by: Leo Liu <11664880+silver886@users.noreply.github.com>
24 lines
755 B
Go
24 lines
755 B
Go
package e2e_test
|
|
|
|
import (
|
|
"regexp"
|
|
"slices"
|
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
. "github.com/onsi/gomega/gexec"
|
|
)
|
|
|
|
var _ = Describe("podman help", func() {
|
|
It("podman usage base command is podman or podman-remote, without extension ", func() {
|
|
helpSession, err := mb.setCmd(new(helpMachine)).run()
|
|
Expect(err).NotTo(HaveOccurred())
|
|
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())
|
|
})
|
|
})
|