diff options
author | EuAndreh <eu@euandre.org> | 2025-05-13 07:20:48 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-05-13 15:13:17 -0300 |
commit | 8f4541232bbe127dd90d0fb9a3278e0636b8cba7 (patch) | |
tree | 5c90673d7f7262533044093b4d40bde07982b725 /tests/fuzz/heredoc/gobang.go | |
parent | src/gobang.go: Add Heredoc() (diff) | |
download | gobang-8f4541232bbe127dd90d0fb9a3278e0636b8cba7.tar.gz gobang-8f4541232bbe127dd90d0fb9a3278e0636b8cba7.tar.xz |
Revamp Heredoc(), add fuzz to prevent panics
Diffstat (limited to 'tests/fuzz/heredoc/gobang.go')
-rw-r--r-- | tests/fuzz/heredoc/gobang.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/fuzz/heredoc/gobang.go b/tests/fuzz/heredoc/gobang.go new file mode 100644 index 0000000..e4cb9c6 --- /dev/null +++ b/tests/fuzz/heredoc/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) { + Heredoc(s) + }) +} + + + +func MainTest() { + fuzzTargets := []testing.InternalFuzzTarget{ + { "heredoc", 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()) +} |