MCPcopy Index your code
hub / github.com/expr-lang/expr / TestCreateDoc_Ambiguous

Function TestCreateDoc_Ambiguous

docgen/docgen_test.go:155–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

153}
154
155func TestCreateDoc_Ambiguous(t *testing.T) {
156 doc := CreateDoc(&EnvAmbiguous{})
157 expected := &Context{
158 Variables: map[Identifier]*Type{
159 "A": {
160 Kind: "struct",
161 Name: "A",
162 },
163 "AmbiguousField": {
164 Kind: "int",
165 },
166 "B": {
167 Kind: "struct",
168 Name: "B",
169 },
170 "OkField": {
171 Kind: "int",
172 },
173 "C": {
174 Kind: "struct",
175 Name: "C",
176 },
177 },
178 Types: map[TypeName]*Type{
179 "A": {
180 Kind: "struct",
181 Fields: map[Identifier]*Type{
182 "AmbiguousField": {Kind: "int"},
183 "OkField": {Kind: "int"},
184 },
185 },
186 "B": {
187 Kind: "struct",
188 Fields: map[Identifier]*Type{
189 "AmbiguousField": {Kind: "string"},
190 },
191 },
192 "C": {
193 Kind: "struct",
194 Fields: map[Identifier]*Type{
195 "A": {Kind: "struct", Name: "A"},
196 "AmbiguousField": {Kind: "int"},
197 "B": {Kind: "struct", Name: "B"},
198 "OkField": {Kind: "int"},
199 },
200 },
201 },
202 PkgPath: "github.com/expr-lang/expr/docgen_test",
203 }
204
205 assert.Equal(t, expected.Markdown(), doc.Markdown())
206}
207
208func TestCreateDoc_FromMap(t *testing.T) {
209 env := map[string]any{

Callers

nothing calls this directly

Calls 3

MarkdownMethod · 0.95
EqualFunction · 0.92
CreateDocFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…