MCPcopy Index your code
hub / github.com/commitdev/zero / TestValidateProjectNam

Function TestValidateProjectNam

internal/init/prompts_test.go:198–213  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

196}
197
198func TestValidateProjectNam(t *testing.T) {
199 t.Run("Should return error upon invalid project name", func(t *testing.T) {
200 err := initPrompts.ValidateProjectName("0invalid")
201 assert.Error(t, err, "Project name should not start with a number")
202 })
203
204 t.Run("Should return error upon invalid project name length", func(t *testing.T) {
205 err := initPrompts.ValidateProjectName("invalid name with more than 30 characters")
206 assert.Error(t, err, "Project name should not be longer than 30 characters")
207 })
208
209 t.Run("Should return nil upon valid project name", func(t *testing.T) {
210 err := initPrompts.ValidateProjectName("valid-name")
211 assert.Nil(t, err)
212 })
213}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected