(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestIsPascalCase(t *testing.T) { |
| 55 | for _, tc := range []struct { |
| 56 | in string |
| 57 | want bool |
| 58 | }{ |
| 59 | {"", true}, |
| 60 | {"Feat", true}, |
| 61 | {"MyFeature", true}, |
| 62 | {"ParseHTML", true}, |
| 63 | {"MyFeat123", true}, // digits ok |
| 64 | {"myFeature", false}, // starts lowercase |
| 65 | {"My-Feature", false}, // hyphen not allowed |
| 66 | {"My Feature", false}, // space not allowed |
| 67 | } { |
| 68 | got := casing.IsPascalCase(tc.in) |
| 69 | if got != tc.want { |
| 70 | t.Errorf("IsPascalCase(%q) = %v, want %v", tc.in, got, tc.want) |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func TestIsSentenceCase(t *testing.T) { |
| 76 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected