-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cc128d
commit 3c0c4ad
Showing
33 changed files
with
22 additions
and
42 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 |
---|---|---|
@@ -1,29 +1,17 @@ | ||
GO = go | ||
GOGET = $(GO) get -u | ||
|
||
all: check lint | ||
all: check | ||
|
||
check: | ||
$(GO) test -v -cover -race ./... | ||
cd cmd/grab && $(MAKE) -B all | ||
cd v3 && $(GO) test -v -cover -race ./... | ||
cd v3/cmd/grab && $(MAKE) -B all | ||
|
||
install: | ||
$(GO) install -v ./... | ||
cd v3/cmd/grab && $(MAKE) install | ||
|
||
clean: | ||
$(GO) clean -x ./... | ||
cd v3 && $(GO) clean -x ./... | ||
rm -rvf ./.test* | ||
|
||
lint: | ||
gofmt -l -e -s . || : | ||
go vet . || : | ||
golint . || : | ||
gocyclo -over 15 . || : | ||
misspell ./* || : | ||
|
||
deps: | ||
$(GOGET) github.com/golang/lint/golint | ||
$(GOGET) github.com/fzipp/gocyclo | ||
$(GOGET) github.com/client9/misspell/cmd/misspell | ||
|
||
.PHONY: all check install clean lint deps | ||
.PHONY: all check install clean |
File renamed without changes.
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ import ( | |
"testing" | ||
"time" | ||
|
||
"github.com/cavaliercoder/grab/pkg/grabtest" | ||
"github.com/cavaliergopher/grab/v3/pkg/grabtest" | ||
) | ||
|
||
// TestFilenameResolutions tests that the destination filename for Requests can | ||
|
@@ -205,7 +205,7 @@ func TestContentLength(t *testing.T) { | |
func TestAutoResume(t *testing.T) { | ||
segs := 8 | ||
size := 1048576 | ||
sum := grabtest.DefaultHandlerSHA256ChecksumBytes //grabtest.MustHexDecodeString("fbbab289f7f94b25736c58be46a994c441fd02552cc6022352e3d86d2fab7c83") | ||
sum := grabtest.DefaultHandlerSHA256ChecksumBytes //grab/v3test.MustHexDecodeString("fbbab289f7f94b25736c58be46a994c441fd02552cc6022352e3d86d2fab7c83") | ||
filename := ".testAutoResume" | ||
|
||
defer os.Remove(filename) | ||
|
@@ -293,7 +293,7 @@ func TestAutoResume(t *testing.T) { | |
}) | ||
|
||
t.Run("WithNoContentLengthHeaderAndChecksumFailure", func(t *testing.T) { | ||
// ref: https://github.com/cavaliercoder/grab/pull/27 | ||
// ref: https://github.com/cavaliergopher/grab/v3/pull/27 | ||
size := size * 2 | ||
grabtest.WithTestServer(t, func(url string) { | ||
req := mustNewRequest(filename, url) | ||
|
@@ -474,7 +474,6 @@ func TestCancelHangingResponse(t *testing.T) { | |
if resp.BytesComplete() == int64(fileSize) { | ||
t.Error("download was not supposed to be complete") | ||
} | ||
fmt.Println("bye") | ||
}, | ||
grabtest.RateLimiter(1), | ||
grabtest.ContentLength(fileSize), | ||
|
@@ -723,7 +722,7 @@ func TestAfterCopyHook(t *testing.T) { | |
} | ||
|
||
func TestIssue37(t *testing.T) { | ||
// ref: https://github.com/cavaliercoder/grab/issues/37 | ||
// ref: https://github.com/cavaliergopher/grab/v3/issues/37 | ||
filename := "./.testIssue37" | ||
largeSize := int64(2097152) | ||
smallSize := int64(1048576) | ||
|
@@ -764,7 +763,7 @@ func TestIssue37(t *testing.T) { | |
// TestHeadBadStatus validates that HEAD requests that return non-200 can be | ||
// ignored and succeed if the GET requests succeeeds. | ||
// | ||
// Fixes: https://github.com/cavaliercoder/grab/issues/43 | ||
// Fixes: https://github.com/cavaliergopher/grab/v3/issues/43 | ||
func TestHeadBadStatus(t *testing.T) { | ||
expect := http.StatusOK | ||
filename := ".testIssue43" | ||
|
@@ -796,7 +795,7 @@ func TestHeadBadStatus(t *testing.T) { | |
// TestAutoResume also covers cases with checksum validation. | ||
// | ||
// Kudos to Setnička Jiří <[email protected]> for identifying and raising | ||
// a solution to this issue. Ref: https://github.com/cavaliercoder/grab/pull/27 | ||
// a solution to this issue. Ref: https://github.com/cavaliergopher/grab/v3/pull/27 | ||
func TestMissingContentLength(t *testing.T) { | ||
// expectSize must be sufficiently large that DefaultClient.Do won't prefetch | ||
// the entire body and compute ContentLength before returning a Response. | ||
|
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
module github.com/cavaliergopher/grab/v3 | ||
|
||
go 1.14 |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.