From 8f4541232bbe127dd90d0fb9a3278e0636b8cba7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 13 May 2025 07:20:48 -0300 Subject: Revamp Heredoc(), add fuzz to prevent panics --- tests/fuzz/count-leading-chars/gobang.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/fuzz/count-leading-chars/gobang.go (limited to 'tests/fuzz/count-leading-chars/gobang.go') diff --git a/tests/fuzz/count-leading-chars/gobang.go b/tests/fuzz/count-leading-chars/gobang.go new file mode 100644 index 0000000..5b9736d --- /dev/null +++ b/tests/fuzz/count-leading-chars/gobang.go @@ -0,0 +1,30 @@ +package gobang + +import ( + "os" + "testing" + "testing/internal/testdeps" +) + + + +func fn(f *testing.F) { + f.Fuzz(func(t *testing.T, s string, c byte) { + countLeadingChar(s, c) + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "count-leading-char", fn }, + } + + deps := testdeps.TestDeps{} + tests := []testing.InternalTest {} + benchmarks := []testing.InternalBenchmark{} + examples := []testing.InternalExample {} + m := testing.MainStart(deps, tests, benchmarks, fuzzTargets, examples) + os.Exit(m.Run()) +} -- cgit v1.2.3