MCPcopy Create free account
hub / github.com/goadesign/goa / TestFixReservedGo

Function TestFixReservedGo

codegen/goify_test.go:9–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func 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}

Callers

nothing calls this directly

Calls 2

fixReservedGoFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected