github.com/cheikhshift/buffalo@v0.9.5/buffalo/cmd/new_test.go (about) 1 package cmd 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func Test_nameHasIllegalCharacter(t *testing.T) { 10 m := map[string]bool{ 11 "coke": false, 12 "my-coke": false, 13 "my_coke": false, 14 "COKE": false, 15 "MY-COKE": false, 16 "MY_COKE": false, 17 "123COKE": false, 18 "1(3c&ke": true, 19 "github.com/markbates/coke": true, 20 } 21 for k, v := range m { 22 t.Run(k, func(st *testing.T) { 23 r := require.New(st) 24 r.Equal(v, nameHasIllegalCharacter(k)) 25 }) 26 } 27 }