summaryrefslogtreecommitdiff
path: root/vendor/github.com/Masterminds/semver/v3/fuzz.go
blob: a242ad70587cef6a5bf9f4aae80b63cab28e57f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// +build gofuzz

package semver

func Fuzz(data []byte) int {
	d := string(data)

	// Test NewVersion
	_, _ = NewVersion(d)

	// Test StrictNewVersion
	_, _ = StrictNewVersion(d)

	// Test NewConstraint
	_, _ = NewConstraint(d)

	// The return value should be 0 normally, 1 if the priority in future tests
	// should be increased, and -1 if future tests should skip passing in that
	// data. We do not have a reason to change priority so 0 is always returned.
	// There are example tests that do this.
	return 0
}