(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func TestGenFishCompletionFile(t *testing.T) { |
| 102 | tmpFile, err := os.CreateTemp("", "cobra-test") |
| 103 | if err != nil { |
| 104 | t.Fatal(err.Error()) |
| 105 | } |
| 106 | |
| 107 | defer os.Remove(tmpFile.Name()) |
| 108 | |
| 109 | rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun} |
| 110 | child := &Command{ |
| 111 | Use: "child", |
| 112 | ValidArgsFunction: validArgsFunc, |
| 113 | Run: emptyRun, |
| 114 | } |
| 115 | rootCmd.AddCommand(child) |
| 116 | |
| 117 | assertNoErr(t, rootCmd.GenFishCompletionFile(tmpFile.Name(), false)) |
| 118 | } |
| 119 | |
| 120 | func TestFailGenFishCompletionFile(t *testing.T) { |
| 121 | tmpDir, err := os.MkdirTemp("", "cobra-test") |
nothing calls this directly
no test coverage detected