MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestIsValidPRDName

Function TestIsValidPRDName

internal/cmd/new_test.go:10–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func 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
39func TestRunNewCreatesDirectory(t *testing.T) {
40 // Create a temporary directory for testing

Callers

nothing calls this directly

Calls 2

RunMethod · 0.80
isValidPRDNameFunction · 0.70

Tested by

no test coverage detected