(t *testing.T)
| 355 | } |
| 356 | |
| 357 | func TestMergeBodiesPartialContent(t *testing.T) { |
| 358 | tests := []struct { |
| 359 | Bodies []Body |
| 360 | Schema *BodySchema |
| 361 | WantContent *BodyContent |
| 362 | WantRemain Body |
| 363 | DiagCount int |
| 364 | }{ |
| 365 | { |
| 366 | []Body{}, |
| 367 | &BodySchema{}, |
| 368 | &BodyContent{ |
| 369 | Attributes: map[string]*Attribute{}, |
| 370 | }, |
| 371 | mergedBodies{}, |
| 372 | 0, |
| 373 | }, |
| 374 | { |
| 375 | []Body{ |
| 376 | &testMergedBodiesVictim{ |
| 377 | Name: "first", |
| 378 | HasAttributes: []string{"name", "age"}, |
| 379 | }, |
| 380 | }, |
| 381 | &BodySchema{ |
| 382 | Attributes: []AttributeSchema{ |
| 383 | { |
| 384 | Name: "name", |
| 385 | }, |
| 386 | }, |
| 387 | }, |
| 388 | &BodyContent{ |
| 389 | Attributes: map[string]*Attribute{ |
| 390 | "name": &Attribute{ |
| 391 | Name: "name", |
| 392 | NameRange: Range{Filename: "first"}, |
| 393 | }, |
| 394 | }, |
| 395 | }, |
| 396 | mergedBodies{ |
| 397 | &testMergedBodiesVictim{ |
| 398 | Name: "first", |
| 399 | HasAttributes: []string{"age"}, |
| 400 | }, |
| 401 | }, |
| 402 | 0, |
| 403 | }, |
| 404 | { |
| 405 | []Body{ |
| 406 | &testMergedBodiesVictim{ |
| 407 | Name: "first", |
| 408 | HasAttributes: []string{"name", "age"}, |
| 409 | }, |
| 410 | &testMergedBodiesVictim{ |
| 411 | Name: "second", |
| 412 | HasAttributes: []string{"name", "pizza"}, |
| 413 | }, |
| 414 | }, |
nothing calls this directly
no test coverage detected