From a37ac22251a92a6a2899250698c9472778c98463 Mon Sep 17 00:00:00 2001 From: Alexander Zielenski Date: Thu, 10 Mar 2022 11:43:10 -0800 Subject: [PATCH] ensure fuzzer for Info.Title is nonempty --- pkg/validation/spec/gnostic_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/validation/spec/gnostic_test.go b/pkg/validation/spec/gnostic_test.go index 880ce279d..bfcb1fe52 100644 --- a/pkg/validation/spec/gnostic_test.go +++ b/pkg/validation/spec/gnostic_test.go @@ -120,7 +120,7 @@ func gnosticCommonTest(t testing.TB, fuzzer *fuzz.Fuzzer) { *v = &Info{} c.FuzzNoCustom(*v) - (*v).Title = c.RandString() + (*v).Title = c.RandString() + "x" }, func (v *Extensions, c fuzz.Continue) { // gnostic parser only picks up x- vendor extensions @@ -397,6 +397,19 @@ func TestGnosticConversionSmallDeterministic4(t *testing.T) { ) } +func TestGnosticConversionSmallDeterministic5(t *testing.T) { + // A failed case of TestGnosticConversionSmallRandom + // which failed during development/testing loop + gnosticCommonTest( + t, + fuzz. + NewWithSeed(1646940131). + NilChance(0.8). + MaxDepth(10). + NumElements(1, 2), + ) +} + func TestGnosticConversionSmallRandom(t *testing.T) { seed := time.Now().Unix()