MCPcopy
hub / github.com/hashicorp/hcl / TestMergedBodiesContent

Function TestMergedBodiesContent

merged_test.go:14–355  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestMergedBodiesContent(t *testing.T) {
15 tests := []struct {
16 Bodies []Body
17 Schema *BodySchema
18 Want *BodyContent
19 DiagCount int
20 }{
21 {
22 []Body{},
23 &BodySchema{},
24 &BodyContent{
25 Attributes: map[string]*Attribute{},
26 },
27 0,
28 },
29 {
30 []Body{},
31 &BodySchema{
32 Attributes: []AttributeSchema{
33 {
34 Name: "name",
35 },
36 },
37 },
38 &BodyContent{
39 Attributes: map[string]*Attribute{},
40 },
41 0,
42 },
43 {
44 []Body{},
45 &BodySchema{
46 Attributes: []AttributeSchema{
47 {
48 Name: "name",
49 Required: true,
50 },
51 },
52 },
53 &BodyContent{
54 Attributes: map[string]*Attribute{},
55 },
56 1,
57 },
58 {
59 []Body{
60 &testMergedBodiesVictim{
61 HasAttributes: []string{"name"},
62 },
63 },
64 &BodySchema{
65 Attributes: []AttributeSchema{
66 {
67 Name: "name",
68 },
69 },
70 },
71 &BodyContent{

Callers

nothing calls this directly

Calls 3

MergeBodiesFunction · 0.85
RunMethod · 0.80
ContentMethod · 0.65

Tested by

no test coverage detected