Commit f87c9a3f authored by Cristian Maglie's avatar Cristian Maglie

Updated go.bug.st/relaxed-semver from `634f2c8` to `0265409`

Fix #110
parent a9f6f6e4
......@@ -321,11 +321,11 @@
[[projects]]
branch = "master"
digest = "1:e39f0518cc8a9d0d35fdef12df30ddf1260424a8c8fa3909063b1673a21a7459"
digest = "1:ad7c27ec39e9523a7412cad155c414d0871cb02a8e975dcf269eb2e55edba224"
name = "go.bug.st/relaxed-semver"
packages = ["."]
pruneopts = "UT"
revision = "634f2c8a7dad58007b2539ce542ba69f1e50893c"
revision = "0265409c585220cffdb70af2966e80044958b9a9"
[[projects]]
branch = "master"
......
//
// Copyright 2018 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// +build gofuzz
package semver
// Fuzz is used for fuzzy testing the project
func Fuzz(data []byte) int {
v, err := Parse(string(data))
if err != nil {
if v != nil {
panic("v != nil on error")
}
return 0
}
if v.String() != string(data) {
panic("reserialized string != deserialized string")
}
v.Normalize()
if v.CompareTo(v) != 0 {
panic("compare != 0 while comparing with self")
}
r := ParseRelaxed(string(data))
if r.String() != string(data) {
panic("reserialized relaxed string != deserialized string")
}
return 1
}
......@@ -222,6 +222,7 @@ func Parse(inVersioin string) (*Version, error) {
// Builds parsing
buildIdx := currIdx + 1
if curr == '+' {
for {
if hasNext := next(); !hasNext || curr == '.' {
if buildIdx == currIdx {
......@@ -241,4 +242,6 @@ func Parse(inVersioin string) (*Version, error) {
}
return nil, fmt.Errorf("invalid separator for builds: '%c'", curr)
}
}
return nil, fmt.Errorf("invalid separator: '%c'", curr)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment