(t *testing.T)
| 100 | } |
| 101 | |
| 102 | func TestGenMdTree(t *testing.T) { |
| 103 | c := &cobra.Command{Use: "do [OPTIONS] arg1 arg2"} |
| 104 | tmpdir, err := os.MkdirTemp("", "test-gen-md-tree") |
| 105 | if err != nil { |
| 106 | t.Fatalf("Failed to create tmpdir: %v", err) |
| 107 | } |
| 108 | defer os.RemoveAll(tmpdir) |
| 109 | |
| 110 | if err := GenMarkdownTreeCustom(c, tmpdir, func(s string) string { return s }, func(s string) string { return s }); err != nil { |
| 111 | t.Fatalf("GenMarkdownTree failed: %v", err) |
| 112 | } |
| 113 | |
| 114 | if _, err := os.Stat(filepath.Join(tmpdir, "do.md")); err != nil { |
| 115 | t.Fatalf("Expected file 'do.md' to exist") |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | func BenchmarkGenMarkdownToFile(b *testing.B) { |
| 120 | file, err := os.CreateTemp(b.TempDir(), "") |
nothing calls this directly
no test coverage detected