-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
download: include goget tests + hacky hack
- Loading branch information
1 parent
5379fa0
commit 66b2be1
Showing
2 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package goget | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
) | ||
|
||
type testCase struct { | ||
name string | ||
mod string | ||
version string | ||
} | ||
|
||
// TODO(marwan): we should create Test Repos under github.com/gomods | ||
// so we can get reproducible results from live VCS repos. | ||
// For now, I cannot test that github.com/pkg/errors returns v0.8.0 | ||
// from goget.Latest, because they could very well introduce a new tag | ||
// in the near future. | ||
var tt = []testCase{ | ||
{"basic list", "github.com/pkg/errors", "latest"}, | ||
{"list non tagged", "github.com/marwan-at-work/gowatch", "latest"}, | ||
{"list vanity", "golang.org/x/tools", "latest"}, | ||
} | ||
|
||
func TestList(t *testing.T) { | ||
dp := New() | ||
ctx := context.Background() | ||
|
||
for _, tc := range tt { | ||
t.Run(tc.name, func(t *testing.T) { | ||
_, err := dp.List(ctx, tc.mod) // TODO ensure list is correct per TODO above. | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
}) | ||
} | ||
} |