(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestIsSnakeCase(t *testing.T) { |
| 97 | for _, tc := range []struct { |
| 98 | in string |
| 99 | want bool |
| 100 | }{ |
| 101 | {"", true}, |
| 102 | {"feat", true}, |
| 103 | {"my_feature", true}, |
| 104 | {"snake_case", true}, |
| 105 | {"v2_api", true}, // digit allowed |
| 106 | {"MyFeature", false}, // uppercase |
| 107 | {"my-feature", false}, // hyphen |
| 108 | {"my feature", false}, // space |
| 109 | } { |
| 110 | got := casing.IsSnakeCase(tc.in) |
| 111 | if got != tc.want { |
| 112 | t.Errorf("IsSnakeCase(%q) = %v, want %v", tc.in, got, tc.want) |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | func TestIsStartCase(t *testing.T) { |
| 118 | for _, tc := range []struct { |
nothing calls this directly
no test coverage detected