Skip to content

Commit a37ac22

Browse files
author
Alexander Zielenski
committed
ensure fuzzer for Info.Title is nonempty
1 parent e6604a5 commit a37ac22

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pkg/validation/spec/gnostic_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func gnosticCommonTest(t testing.TB, fuzzer *fuzz.Fuzzer) {
120120
*v = &Info{}
121121
c.FuzzNoCustom(*v)
122122

123-
(*v).Title = c.RandString()
123+
(*v).Title = c.RandString() + "x"
124124
},
125125
func (v *Extensions, c fuzz.Continue) {
126126
// gnostic parser only picks up x- vendor extensions
@@ -397,6 +397,19 @@ func TestGnosticConversionSmallDeterministic4(t *testing.T) {
397397
)
398398
}
399399

400+
func TestGnosticConversionSmallDeterministic5(t *testing.T) {
401+
// A failed case of TestGnosticConversionSmallRandom
402+
// which failed during development/testing loop
403+
gnosticCommonTest(
404+
t,
405+
fuzz.
406+
NewWithSeed(1646940131).
407+
NilChance(0.8).
408+
MaxDepth(10).
409+
NumElements(1, 2),
410+
)
411+
}
412+
400413

401414
func TestGnosticConversionSmallRandom(t *testing.T) {
402415
seed := time.Now().Unix()

0 commit comments

Comments
 (0)