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

Function FuzzParseExpression

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

Source from the content-addressed store, hash-verified

37}
38
39func FuzzParseExpression(f *testing.F) {
40 f.Fuzz(func(t *testing.T, data []byte) {
41 _, diags := hclsyntax.ParseExpression(data, "<fuzz-expr>", hcl.Pos{Line: 1, Column: 1})
42
43 if diags.HasErrors() {
44 t.Logf("Error when parsing expression %v", data)
45 for _, diag := range diags {
46 t.Logf("- %s", diag.Error())
47 }
48 }
49 })
50}
51
52func FuzzParseConfig(f *testing.F) {
53 f.Fuzz(func(t *testing.T, data []byte) {

Callers

nothing calls this directly

Calls 3

ParseExpressionFunction · 0.92
HasErrorsMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected