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

Function FuzzParseTemplate

hclsyntax/fuzz/fuzz_test.go:13–24  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

11)
12
13func FuzzParseTemplate(f *testing.F) {
14 f.Fuzz(func(t *testing.T, data []byte) {
15 _, diags := hclsyntax.ParseTemplate(data, "<fuzz-tmpl>", hcl.Pos{Line: 1, Column: 1})
16
17 if diags.HasErrors() {
18 t.Logf("Error when parsing template %v", data)
19 for _, diag := range diags {
20 t.Logf("- %s", diag.Error())
21 }
22 }
23 })
24}
25
26func FuzzParseTraversalAbs(f *testing.F) {
27 f.Fuzz(func(t *testing.T, data []byte) {

Callers

nothing calls this directly

Calls 3

ParseTemplateFunction · 0.92
HasErrorsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected