mirror of
https://github.com/regclient/regclient.git
synced 2025-04-18 22:44:00 +03:00
Fix: Platform test for darwin/macos should not add variant
Variant is only added automatically to platform splits with a single field ('linux' or 'darwin'). Signed-off-by: Brandon Mitchell <git@bmitch.net>
This commit is contained in:
parent
1c009ee2cd
commit
7868e550a1
@ -20,20 +20,11 @@ func TestPlatformParse(t *testing.T) {
|
||||
winGoal.Variant = platLocal.Variant
|
||||
winGoal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
linuxAMD64Goal := Platform{OS: "linux", Architecture: "amd64"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, linuxAMD64Goal) {
|
||||
linuxAMD64Goal.Variant = platLocal.Variant
|
||||
linuxAMD64Goal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
darwinAMD64Goal := Platform{OS: "darwin", Architecture: "amd64"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, darwinAMD64Goal) {
|
||||
darwinAMD64Goal.Variant = platLocal.Variant
|
||||
darwinAMD64Goal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
darwinARM64Goal := Platform{OS: "darwin", Architecture: "arm64"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, darwinARM64Goal) {
|
||||
darwinARM64Goal.Variant = platLocal.Variant
|
||||
darwinARM64Goal.OSVersion = platLocal.OSVersion
|
||||
darwinGoal := Platform{OS: "darwin"}
|
||||
if Compatible(Platform{OS: platLocal.OS}, darwinGoal) {
|
||||
darwinGoal.Architecture = platLocal.Architecture
|
||||
darwinGoal.Variant = platLocal.Variant
|
||||
darwinGoal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
windowsAMD64Goal := Platform{OS: "windows", Architecture: "amd64"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, windowsAMD64Goal) {
|
||||
@ -41,8 +32,8 @@ func TestPlatformParse(t *testing.T) {
|
||||
windowsAMD64Goal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
windowsAMD64v2Goal := Platform{OS: "windows", Architecture: "amd64", Variant: "v2"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, windowsAMD64Goal) {
|
||||
windowsAMD64Goal.OSVersion = platLocal.OSVersion
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, windowsAMD64v2Goal) {
|
||||
windowsAMD64v2Goal.OSVersion = platLocal.OSVersion
|
||||
}
|
||||
localAMD64Goal := Platform{OS: platLocal.OS, Architecture: "amd64"}
|
||||
if Compatible(Platform{OS: platLocal.OS, Architecture: platLocal.Architecture}, localAMD64Goal) {
|
||||
@ -135,15 +126,20 @@ func TestPlatformParse(t *testing.T) {
|
||||
parse: "linux",
|
||||
goal: linuxGoal,
|
||||
},
|
||||
{
|
||||
name: "darwin",
|
||||
parse: "darwin",
|
||||
goal: darwinGoal,
|
||||
},
|
||||
{
|
||||
name: "macos amd64",
|
||||
parse: "macos/amd64",
|
||||
goal: darwinAMD64Goal,
|
||||
goal: Platform{OS: "darwin", Architecture: "amd64"},
|
||||
},
|
||||
{
|
||||
name: "darwin arm64",
|
||||
parse: "darwin/arm64",
|
||||
goal: darwinARM64Goal,
|
||||
goal: Platform{OS: "darwin", Architecture: "arm64"},
|
||||
},
|
||||
{
|
||||
name: "windows amd64 with version",
|
||||
|
Loading…
x
Reference in New Issue
Block a user