(t *testing.T)
| 29 | } |
| 30 | |
| 31 | func TestIsKebabCase(t *testing.T) { |
| 32 | for _, tc := range []struct { |
| 33 | in string |
| 34 | want bool |
| 35 | }{ |
| 36 | {"", true}, |
| 37 | {"feat", true}, |
| 38 | {"my-feature", true}, |
| 39 | {"kebab-case", true}, |
| 40 | {"v2-api", true}, // digit allowed |
| 41 | {"my--feat", true}, // consecutive hyphens: spec doesn't forbid them |
| 42 | {"MyFeature", false}, // uppercase |
| 43 | {"my_feature", false}, // underscore |
| 44 | {"my feature", false}, // space |
| 45 | {"MY-FEAT", false}, // uppercase letters |
| 46 | } { |
| 47 | got := casing.IsKebabCase(tc.in) |
| 48 | if got != tc.want { |
| 49 | t.Errorf("IsKebabCase(%q) = %v, want %v", tc.in, got, tc.want) |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func TestIsPascalCase(t *testing.T) { |
| 55 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected