Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Improve godep import tests
Browse files Browse the repository at this point in the history
- Adds test for PariedVersion in godep_config.
- Adds dependency constraints in gopath-initial for godep integration
tests when -skip-tools is used. This differentiates final locks for with
and without tools.
  • Loading branch information
darkowlzz committed May 17, 2017
1 parent 5c59560 commit c637683
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
18 changes: 15 additions & 3 deletions cmd/dep/godep_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"testing"

"github.com/golang/dep"
"github.com/golang/dep/internal/gps"
"github.com/golang/dep/internal/test"
)

Expand Down Expand Up @@ -102,9 +103,20 @@ func TestGodepConvertProject(t *testing.T) {
t.Fatalf("Expected the lock to have a project for 'github.com/sdboyer/deptest' but got '%s'", p.Ident().ProjectRoot)
}

lv := p.Version().String()
if lv != "v1.0.0" {
t.Fatalf("Expected locked revision to be 'v1.0.0', got %s", lv)
lv := p.Version()
lpv, ok := lv.(gps.PairedVersion)
if !ok {
t.Fatalf("Expected locked version to be PairedVersion but got %T", lv)
}

rev := lpv.Underlying()
if rev != "6a741be0cc55ecbe4f45690ebfd606a956d5f14a" {
t.Fatalf("Expected locked revision to be '6a741be0cc55ecbe4f45690ebfd606a956d5f14a', got %s", rev)
}

ver := lpv.String()
if ver != "v1.0.0" {
t.Fatalf("Expected locked version to be 'v1.0.0', got %s", ver)
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
["init", "-no-examples", "-skip-tools"]
],
"error-expected": "",
"gopath-initial": {},
"gopath-initial": {
"github.com/sdboyer/deptest": "3f4c3bea144e112a69bbe5d8d01c1b09a544253f",
"github.com/sdboyer/deptestdos": "5c607206be5decd28e6263ffffdcee067266015e"
},
"vendor-final": [
"github.com/sdboyer/deptest",
"github.com/sdboyer/deptestdos"
Expand Down

0 comments on commit c637683

Please sign in to comment.