generated from LinuxSuRen/github-go
-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
2814b0e
commit b7057b6
Showing
9 changed files
with
134 additions
and
23 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
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,13 @@ | ||
<html> | ||
<head></head> | ||
<table> | ||
<tr> | ||
<td> | ||
<a href="magnet:?xxx">magnet:?xxx</a> | ||
</td> | ||
<td> | ||
<a href="https://github.com">github</a> | ||
</td> | ||
</tr> | ||
</table> | ||
</html> |
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
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,16 @@ | ||
// This package provides net related functions | ||
package net | ||
|
||
import "fmt" | ||
|
||
// FakeReader is a fake reader for the test purpose | ||
type FakeReader struct { | ||
ExpectErr error | ||
} | ||
|
||
// Read is a fake method | ||
func (e *FakeReader) Read(p []byte) (n int, err error) { | ||
err = e.ExpectErr | ||
fmt.Println(err, "fake") | ||
return | ||
} |
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,17 @@ | ||
package net_test | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
|
||
"github.com/linuxsuren/http-downloader/pkg/net" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFakeReader(t *testing.T) { | ||
reader := &net.FakeReader{ | ||
ExpectErr: errors.New("error"), | ||
} | ||
_, err := reader.Read(nil) | ||
assert.NotNil(t, err) | ||
} |
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