26 lines
489 B
Go
26 lines
489 B
Go
package featuremodules
|
|
|
|
import "testing"
|
|
|
|
func TestIsValidKey(t *testing.T) {
|
|
cases := []struct {
|
|
key string
|
|
want bool
|
|
}{
|
|
{"online_shop", true},
|
|
{"catalogs", true},
|
|
{"cartridges", true},
|
|
{"service", false},
|
|
{"", false},
|
|
{"online-shop", false},
|
|
{"ONLINE_SHOP", false},
|
|
}
|
|
for _, tc := range cases {
|
|
t.Run(tc.key, func(t *testing.T) {
|
|
if got := isValidKey(tc.key); got != tc.want {
|
|
t.Errorf("isValidKey(%q) = %v, want %v", tc.key, got, tc.want)
|
|
}
|
|
})
|
|
}
|
|
}
|