MCPcopy Index your code
hub / github.com/cheat/cheat / FuzzParseDelimiterHandling

Function FuzzParseDelimiterHandling

internal/sheet/parse_fuzz_test.go:103–132  ·  view source on GitHub ↗

FuzzParseDelimiterHandling specifically tests delimiter edge cases

(f *testing.F)

Source from the content-addressed store, hash-verified

101
102// FuzzParseDelimiterHandling specifically tests delimiter edge cases
103func FuzzParseDelimiterHandling(f *testing.F) {
104 // Seed corpus focusing on delimiter variations
105 f.Add("---", "content")
106 f.Add("", "---")
107 f.Add("---", "---")
108 f.Add("", "")
109
110 f.Fuzz(func(t *testing.T, prefix string, suffix string) {
111 // Build input with controllable parts around delimiters
112 inputs := []string{
113 prefix + "---\n" + suffix,
114 prefix + "---\r\n" + suffix,
115 prefix + "---\n---\n" + suffix,
116 prefix + "---\r\n---\r\n" + suffix,
117 prefix + "---\n" + "yaml: data\n" + "---\n" + suffix,
118 }
119
120 for _, input := range inputs {
121 func() {
122 defer func() {
123 if r := recover(); r != nil {
124 t.Errorf("parse panicked with constructed input: %v", r)
125 }
126 }()
127
128 _, _, _ = parse(input)
129 }()
130 }
131 })
132}

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected