(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestIsSentenceCase(t *testing.T) { |
| 76 | for _, tc := range []struct { |
| 77 | in string |
| 78 | want bool |
| 79 | }{ |
| 80 | {"", true}, |
| 81 | {"Feat", true}, |
| 82 | {"My feature", true}, |
| 83 | {"Add endpoint", true}, |
| 84 | {"Fix #123", true}, // punctuation and digit allowed |
| 85 | {"feat", false}, // starts lowercase |
| 86 | {"My Feature", false}, // second word capitalised |
| 87 | {"MY FEATURE", false}, // fully uppercased |
| 88 | } { |
| 89 | got := casing.IsSentenceCase(tc.in) |
| 90 | if got != tc.want { |
| 91 | t.Errorf("IsSentenceCase(%q) = %v, want %v", tc.in, got, tc.want) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func TestIsSnakeCase(t *testing.T) { |
| 97 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected