Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Dec 19, 2023
1 parent b6cb584 commit 3fd508d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cmd/carapace/cmd/invoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/rsteube/carapace/pkg/style"
)

// TODO ensure ActionCarapaceBin invokes the test binary

func TestInvokeFlags(t *testing.T) {
sandbox.Package(t, "github.com/rsteube/carapace-bin/cmd/carapace")(func(s *sandbox.Sandbox) {
s.Run("tail", "export", "tail", "--fo").
Expand All @@ -25,3 +27,20 @@ func TestInvokeFlags(t *testing.T) {
Usage("output appended data as the file grows"))
})
}

func TestInvokePositional(t *testing.T) {
sandbox.Package(t, "github.com/rsteube/carapace-bin/cmd/carapace")(func(s *sandbox.Sandbox) {
s.Run("git", "export", "git", "checko").
Expect(carapace.Batch(
carapace.ActionValuesDescribed(
"checkout", "Switch branches or restore working tree files",
).Style(style.Blue).
Tag("main commands"),
carapace.ActionValuesDescribed(
"checkout-index", "Copy files from the index to the working tree",
).Style(style.Of(style.Dim, style.Yellow)).
Tag("low-level manipulator commands"),
).ToA().
Usage("carapace [flags] [COMPLETER] [bash|elvish|fish|nushell|oil|powershell|tcsh|xonsh|zsh]"))
})
}

0 comments on commit 3fd508d

Please sign in to comment.