Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,30 @@ func TestYtDlp(t *testing.T) {
testCases := map[string]string{
// not ideal, but good enough
"darwin/amd64": "yt-dlp_macos",
"linux/amd64": "yt-dlp_musllinux.zip",
"linux/arm": "yt-dlp_linux_armv7l.zip",
"linux/arm64": "yt-dlp_linux_aarch64",
}
batchCheckAssets(t, w, testCases)

var result handler.QueryResult
if err := json.Unmarshal(w.Body.Bytes(), &result); err != nil {
t.Fatalf("failed to decode JSON response: %v", err)
}
var targetAsset *handler.Asset
for i := range result.Assets {
if result.Assets[i].OS == "linux" && result.Assets[i].Arch == "amd64" {
targetAsset = &result.Assets[i]
break
}
}
if targetAsset == nil {
t.Fatalf("linux/amd64 asset not found in response")
}
switch targetAsset.Name {
case "yt-dlp_linux.zip", "yt-dlp_musllinux.zip":
default:
t.Fatalf("expected linux/amd64 asset name one of [yt-dlp_linux.zip yt-dlp_musllinux.zip], got %q", targetAsset.Name)
}
}

func TestJPilloraServe(t *testing.T) {
Expand Down