From bc682800eb4bc77b4e63a0cc84e69bf2b41cb624 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 16 May 2025 05:14:03 -0300 Subject: tests/fuzz/heredoc/gobang.go: Add invariant property to the test --- tests/fuzz/heredoc/gobang.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/fuzz/heredoc/gobang.go') diff --git a/tests/fuzz/heredoc/gobang.go b/tests/fuzz/heredoc/gobang.go index e4cb9c6..c685391 100644 --- a/tests/fuzz/heredoc/gobang.go +++ b/tests/fuzz/heredoc/gobang.go @@ -10,7 +10,11 @@ import ( func fn(f *testing.F) { f.Fuzz(func(t *testing.T, s string) { - Heredoc(s) + out := Heredoc(s) + trimmedOut := out[:len(out) - 1] + if len(trimmedOut) > len(s) { + t.Errorf("bad length: %v, %v", len(trimmedOut), len(s)) + } }) } -- cgit v1.2.3