Skip to content

Commit

Permalink
Fixes issue with module path for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfarina committed Sep 13, 2019
1 parent 0337c9b commit a39655a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions benchmark_test.go
@@ -1,9 +1,7 @@
package semver_test
package semver

import (
"testing"

"github.com/Masterminds/semver"
)

/* Constraint creation benchmarks */
Expand All @@ -12,7 +10,7 @@ func benchNewConstraint(c string, b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _ = semver.NewConstraint(c)
_, _ = NewConstraint(c)
}
}

Expand Down Expand Up @@ -57,8 +55,8 @@ func BenchmarkNewConstraintUnion(b *testing.B) {
func benchCheckVersion(c, v string, b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
version, _ := semver.NewVersion(v)
constraint, _ := semver.NewConstraint(c)
version, _ := NewVersion(v)
constraint, _ := NewConstraint(c)

for i := 0; i < b.N; i++ {
constraint.Check(version)
Expand Down Expand Up @@ -104,8 +102,8 @@ func BenchmarkCheckVersionUnion(b *testing.B) {
func benchValidateVersion(c, v string, b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
version, _ := semver.NewVersion(v)
constraint, _ := semver.NewConstraint(c)
version, _ := NewVersion(v)
constraint, _ := NewConstraint(c)

for i := 0; i < b.N; i++ {
constraint.Validate(version)
Expand Down Expand Up @@ -190,13 +188,13 @@ func BenchmarkValidateVersionUnionFail(b *testing.B) {

func benchNewVersion(v string, b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = semver.NewVersion(v)
_, _ = NewVersion(v)
}
}

func benchStrictNewVersion(v string, b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = semver.StrictNewVersion(v)
_, _ = StrictNewVersion(v)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,3 +1,3 @@
module github.com/Masterminds/semver
module github.com/Masterminds/semver/v3

go 1.12

0 comments on commit a39655a

Please sign in to comment.