-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub_test.go
More file actions
36 lines (33 loc) · 833 Bytes
/
github_test.go
File metadata and controls
36 lines (33 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package release
import (
"fmt"
"testing"
)
const (
rcloneVer = "1.63.0"
ytVer = "2023.06.22"
)
func TestGithub(t *testing.T) {
tests{
{
InputRepo: "rclone/rclone", InputMatch: "", F: Github,
Expected: fmt.Sprintf("https://github.com/rclone/rclone/releases/download/v%s/rclone-v%s-linux-amd64.deb", rcloneVer, rcloneVer),
ExpectedErr: nil,
},
{
InputRepo: "myztillx-test-repo", InputMatch: "", F: Github,
Expected: "",
ExpectedErr: ErrImproperRepo,
},
{
InputRepo: "myztillx/test-repo", InputMatch: "", F: Github,
Expected: "",
ExpectedErr: ErrNoAssets,
},
{
InputRepo: "yt-dlp/yt-dlp", InputMatch: "_linux", F: Github,
Expected: fmt.Sprintf("https://github.com/yt-dlp/yt-dlp/releases/download/%s/yt-dlp_linux", ytVer),
ExpectedErr: nil,
},
}.validate(t)
}