MCPcopy Create free account
hub / github.com/brettlangdon/forge / TestMergeSectionFailSectionToField

Function TestMergeSectionFailSectionToField

section_test.go:117–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestMergeSectionFailSectionToField(t *testing.T) {
118 config1Str := `
119global = "global value";
120
121prod {
122 value = "string value";
123 integer = 500
124 float = 80.80
125 boolean = true
126 negative = FALSE
127 nothing = NULL
128}
129 `
130
131 config2Str := `
132global = "global value";
133
134prod = "I'm prod value"
135 `
136
137 config1, err := forge.ParseString(config1Str)
138 if err != nil {
139 t.Error(err)
140 t.FailNow()
141 }
142
143 config2, err := forge.ParseString(config2Str)
144 if err != nil {
145 t.Error(err)
146 t.FailNow()
147 }
148
149 err = config1.Merge(config2)
150 if err.Error() != "source (STRING) and target (SECTION) type doesn't match: prod" {
151 t.Error(err)
152 }
153}

Callers

nothing calls this directly

Calls 1

MergeMethod · 0.80

Tested by

no test coverage detected