(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestIsValidPRDName(t *testing.T) { |
| 11 | tests := []struct { |
| 12 | name string |
| 13 | input string |
| 14 | expected bool |
| 15 | }{ |
| 16 | {"valid lowercase", "main", true}, |
| 17 | {"valid with numbers", "feature1", true}, |
| 18 | {"valid with hyphen", "my-feature", true}, |
| 19 | {"valid with underscore", "my_feature", true}, |
| 20 | {"valid mixed case", "MyFeature", true}, |
| 21 | {"valid complex", "auth-v2_final", true}, |
| 22 | {"empty string", "", false}, |
| 23 | {"with space", "my feature", false}, |
| 24 | {"with dot", "my.feature", false}, |
| 25 | {"with slash", "my/feature", false}, |
| 26 | {"with special char", "my@feature", false}, |
| 27 | } |
| 28 | |
| 29 | for _, tt := range tests { |
| 30 | t.Run(tt.name, func(t *testing.T) { |
| 31 | result := isValidPRDName(tt.input) |
| 32 | if result != tt.expected { |
| 33 | t.Errorf("isValidPRDName(%q) = %v, want %v", tt.input, result, tt.expected) |
| 34 | } |
| 35 | }) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestRunNewCreatesDirectory(t *testing.T) { |
| 40 | // Create a temporary directory for testing |
nothing calls this directly
no test coverage detected