Fuzz text metric parser with with github.com/dvyukov/go-fuzz: go-fuzz-build github.com/prometheus/common/expfmt go-fuzz -bin expfmt-fuzz.zip -workdir fuzz Further input samples should go in the folder fuzz/corpus.
(in []byte)
| 26 | // |
| 27 | // Further input samples should go in the folder fuzz/corpus. |
| 28 | func Fuzz(in []byte) int { |
| 29 | parser := TextParser{} |
| 30 | _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) |
| 31 | |
| 32 | if err != nil { |
| 33 | return 0 |
| 34 | } |
| 35 | |
| 36 | return 1 |
| 37 | } |
nothing calls this directly
no test coverage detected