(block *hcl.Block)
| 139 | } |
| 140 | |
| 141 | func (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 | |
| 164 | func (r *Runner) decodeTraversalExpectBlock(block *hcl.Block) (*TestFileExpectTraversal, hcl.Diagnostics) { |
| 165 | var diags hcl.Diagnostics |
no test coverage detected