Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
f87c9a3f
Commit
f87c9a3f
authored
Jan 08, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated go.bug.st/relaxed-semver from `634f2c8` to `0265409`
Fix #110
parent
a9f6f6e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
17 deletions
+52
-17
Gopkg.lock
Gopkg.lock
+2
-2
vendor/go.bug.st/relaxed-semver/fuzzer.go
vendor/go.bug.st/relaxed-semver/fuzzer.go
+32
-0
vendor/go.bug.st/relaxed-semver/parser.go
vendor/go.bug.st/relaxed-semver/parser.go
+18
-15
No files found.
Gopkg.lock
View file @
f87c9a3f
...
...
@@ -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"
...
...
vendor/go.bug.st/relaxed-semver/fuzzer.go
0 → 100644
View file @
f87c9a3f
//
// 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
}
vendor/go.bug.st/relaxed-semver/parser.go
View file @
f87c9a3f
...
...
@@ -222,23 +222,26 @@ func Parse(inVersioin string) (*Version, error) {
// Builds parsing
buildIdx
:=
currIdx
+
1
for
{
if
hasNext
:=
next
();
!
hasNext
||
curr
==
'.'
{
if
buildIdx
==
currIdx
{
return
nil
,
fmt
.
Errorf
(
"empty build tag not allowed"
)
if
curr
==
'+'
{
for
{
if
hasNext
:=
next
();
!
hasNext
||
curr
==
'.'
{
if
buildIdx
==
currIdx
{
return
nil
,
fmt
.
Errorf
(
"empty build tag not allowed"
)
}
result
.
builds
=
append
(
result
.
builds
,
in
[
buildIdx
:
currIdx
])
if
!
hasNext
{
return
result
,
nil
}
// Multiple builds
buildIdx
=
currIdx
+
1
continue
}
result
.
builds
=
append
(
result
.
builds
,
in
[
buildIdx
:
currIdx
])
if
!
hasNext
{
return
result
,
nil
if
identifier
[
curr
]
{
continue
}
// Multiple builds
buildIdx
=
currIdx
+
1
continue
}
if
identifier
[
curr
]
{
continue
return
nil
,
fmt
.
Errorf
(
"invalid separator for builds: '%c'"
,
curr
)
}
return
nil
,
fmt
.
Errorf
(
"invalid separator for builds: '%c'"
,
curr
)
}
return
nil
,
fmt
.
Errorf
(
"invalid separator: '%c'"
,
curr
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment