(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestValidAliasExpansionFunc(t *testing.T) { |
| 35 | // Create fake command structure for testing. |
| 36 | issueCmd := &cobra.Command{Use: "issue"} |
| 37 | prCmd := &cobra.Command{Use: "pr"} |
| 38 | prCmd.AddCommand(&cobra.Command{Use: "checkout"}) |
| 39 | |
| 40 | cmd := &cobra.Command{} |
| 41 | cmd.AddCommand(prCmd) |
| 42 | cmd.AddCommand(issueCmd) |
| 43 | |
| 44 | f := ValidAliasExpansionFunc(cmd) |
| 45 | |
| 46 | assert.False(t, f("ps")) |
| 47 | assert.False(t, f("checkout")) |
| 48 | assert.False(t, f("repo list")) |
| 49 | |
| 50 | assert.True(t, f("!git branch --show-current")) |
| 51 | assert.True(t, f("pr")) |
| 52 | assert.True(t, f("pr checkout")) |
| 53 | assert.True(t, f("issue")) |
| 54 | } |
nothing calls this directly
no test coverage detected