(t *testing.T)
| 1090 | } |
| 1091 | |
| 1092 | func TestCheck_builtin_without_call(t *testing.T) { |
| 1093 | tests := []struct { |
| 1094 | input string |
| 1095 | err string |
| 1096 | }{ |
| 1097 | {`len + 1`, "invalid operation: + (mismatched types func(...interface {}) (interface {}, error) and int) (1:5)\n | len + 1\n | ....^"}, |
| 1098 | {`string.A`, "type func(interface {}) string has no field A (1:8)\n | string.A\n | .......^"}, |
| 1099 | } |
| 1100 | |
| 1101 | c := new(checker.Checker) |
| 1102 | for _, test := range tests { |
| 1103 | t.Run(test.input, func(t *testing.T) { |
| 1104 | tree, err := parser.Parse(test.input) |
| 1105 | require.NoError(t, err) |
| 1106 | |
| 1107 | _, err = c.Check(tree, conf.New(nil)) |
| 1108 | require.Error(t, err) |
| 1109 | require.Equal(t, test.err, err.Error()) |
| 1110 | }) |
| 1111 | } |
| 1112 | } |
| 1113 | |
| 1114 | func TestCheck_EmbeddedInterface(t *testing.T) { |
| 1115 | t.Run("embedded interface lookup returns compile-error not panic", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…