Skip to content

Commit acfaba5

Browse files
committed
completion: replace static generators with runtime __complete scripts
1 parent 673f9a8 commit acfaba5

4 files changed

Lines changed: 165 additions & 650 deletions

File tree

completion/command_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func TestCommand_Structure(t *testing.T) {
1515
t.Parallel()
1616

17-
root := newRoot()
17+
root := &rootCmd{}
1818
var buf bytes.Buffer
1919
cmd := completion.Command(root, "myapp", &buf)
2020

@@ -47,7 +47,7 @@ func TestCommand_Structure(t *testing.T) {
4747
func TestCommand_Hidden(t *testing.T) {
4848
t.Parallel()
4949

50-
root := newRoot()
50+
root := &rootCmd{}
5151
var buf bytes.Buffer
5252
cmd := completion.Command(root, "myapp", &buf)
5353

@@ -59,7 +59,7 @@ func TestCommand_Hidden(t *testing.T) {
5959
func TestCommand_ShowsHelp(t *testing.T) {
6060
t.Parallel()
6161

62-
root := newRoot()
62+
root := &rootCmd{}
6363
var buf bytes.Buffer
6464
cmd := completion.Command(root, "myapp", &buf)
6565

@@ -70,7 +70,7 @@ func TestCommand_ShowsHelp(t *testing.T) {
7070
func TestCommand_UsesWriter(t *testing.T) {
7171
t.Parallel()
7272

73-
root := newRoot()
73+
root := &rootCmd{}
7474
var buf bytes.Buffer
7575
cmd := completion.Command(root, "myapp", &buf)
7676

@@ -91,7 +91,7 @@ func TestCommand_UsesWriter(t *testing.T) {
9191
func TestCommand_ShellOutput(t *testing.T) {
9292
t.Parallel()
9393

94-
root := newRoot()
94+
root := &rootCmd{}
9595

9696
shells := []string{"bash", "zsh", "fish", "powershell"}
9797
for _, shell := range shells {

0 commit comments

Comments
 (0)