(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestReverseCmd_Completion(t *testing.T) { |
| 43 | // Cleanup. |
| 44 | dirs.RemoveAllForTest() |
| 45 | |
| 46 | cmd := reverseCmd{} |
| 47 | suggestions, directive := cmd.completion(nil, []string{}, "test") |
| 48 | |
| 49 | // Should return no file completion directive (cobra.ShellCompDirectiveNoFileComp) |
| 50 | // Note: The actual value might differ, so we just check it's a valid directive |
| 51 | if directive < 0 { |
| 52 | t.Errorf("expected valid completion directive, got %d", directive) |
| 53 | } |
| 54 | |
| 55 | // Suggestions might be empty if no ports exist |
| 56 | if suggestions == nil { |
| 57 | t.Error("expected non-nil suggestions slice") |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func TestReverseCmd_ValidatePackageName(t *testing.T) { |
| 62 | // Cleanup. |
nothing calls this directly
no test coverage detected