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

Function FuzzParseConfig

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

Source from the content-addressed store, hash-verified

50}
51
52func FuzzParseConfig(f *testing.F) {
53 f.Fuzz(func(t *testing.T, data []byte) {
54 _, diags := hclsyntax.ParseConfig(data, "<fuzz-conf>", hcl.Pos{Line: 1, Column: 1})
55
56 if diags.HasErrors() {
57 t.Logf("Error when parsing config %v", data)
58 for _, diag := range diags {
59 t.Logf("- %s", diag.Error())
60 }
61 }
62 })
63}

Callers

nothing calls this directly

Calls 3

ParseConfigFunction · 0.92
HasErrorsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected