-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24966 from silver886/patch-2
Remove `.exe` suffix if any in completion
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package e2e_test | ||
|
||
type helpMachine struct { | ||
cmd []string | ||
} | ||
|
||
func (i *helpMachine) buildCmd(m *machineTestBuilder) []string { | ||
cmd := []string{"help"} | ||
i.cmd = cmd | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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()) | ||
}) | ||
}) |