(t *testing.T)
| 170 | } |
| 171 | |
| 172 | func TestGenManTree(t *testing.T) { |
| 173 | c := &cobra.Command{Use: "do [OPTIONS] arg1 arg2"} |
| 174 | tmpdir, err := os.MkdirTemp("", "test-gen-man-tree") |
| 175 | if err != nil { |
| 176 | t.Fatalf("Failed to create tmpdir: %s", err.Error()) |
| 177 | } |
| 178 | defer os.RemoveAll(tmpdir) |
| 179 | |
| 180 | if err := GenManTree(c, tmpdir); err != nil { |
| 181 | t.Fatalf("GenManTree failed: %s", err.Error()) |
| 182 | } |
| 183 | |
| 184 | if _, err := os.Stat(filepath.Join(tmpdir, "do.1")); err != nil { |
| 185 | t.Fatalf("Expected file 'do.1' to exist") |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | func TestManPrintFlagsShowsDefaultValues(t *testing.T) { |
| 190 | type TestOptions struct { |
nothing calls this directly
no test coverage detected