(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestFixReservedGo(t *testing.T) { |
| 10 | cases := map[string]struct { |
| 11 | w string |
| 12 | want string |
| 13 | }{ |
| 14 | "predeclared type": {w: "bool", want: "bool_"}, |
| 15 | "predeclared constant": {w: "true", want: "true_"}, |
| 16 | "predeclared zero value": {w: "nil", want: "nil_"}, |
| 17 | "predeclared function": {w: "append", want: "append_"}, |
| 18 | "non predeclared identifier": {w: "foo", want: "foo"}, |
| 19 | "package": {w: "fmt", want: "fmt_"}, |
| 20 | } |
| 21 | for k, tc := range cases { |
| 22 | t.Run(k, func(t *testing.T) { |
| 23 | assert.Equal(t, tc.want, fixReservedGo(tc.w)) |
| 24 | }) |
| 25 | } |
| 26 | } |
nothing calls this directly
no test coverage detected