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

Method decodeTraversalsBlock

cmd/hclspecsuite/test_file.go:141–162  ·  view source on GitHub ↗
(block *hcl.Block)

Source from the content-addressed store, hash-verified

139}
140
141func (r *Runner) decodeTraversalsBlock(block *hcl.Block) ([]*TestFileExpectTraversal, hcl.Diagnostics) {
142 var diags hcl.Diagnostics
143
144 content, moreDiags := block.Body.Content(testFileTraversalsSchema)
145 diags = append(diags, moreDiags...)
146 if moreDiags.HasErrors() {
147 return nil, diags
148 }
149
150 var ret []*TestFileExpectTraversal
151 for _, block := range content.Blocks {
152 // There's only one block type in our schema, so we can assume all
153 // blocks are of that type.
154 expectTraversal, moreDiags := r.decodeTraversalExpectBlock(block)
155 diags = append(diags, moreDiags...)
156 if expectTraversal != nil {
157 ret = append(ret, expectTraversal)
158 }
159 }
160
161 return ret, diags
162}
163
164func (r *Runner) decodeTraversalExpectBlock(block *hcl.Block) (*TestFileExpectTraversal, hcl.Diagnostics) {
165 var diags hcl.Diagnostics

Callers 1

LoadTestFileMethod · 0.95

Calls 3

HasErrorsMethod · 0.80
ContentMethod · 0.65

Tested by

no test coverage detected