Исправлено удаление пакетов другой архитектуры при установке RPM

This commit is contained in:
2026-02-12 17:58:28 +03:00
parent 3d9f4a0985
commit 108038ef47
3 changed files with 55 additions and 4 deletions

View File

@@ -157,6 +157,29 @@ func TestRegexpALRPackageName(t *testing.T) {
}
}
func TestGoArchToRPMISA(t *testing.T) {
tests := []struct {
goarch string
expected string
}{
{"amd64", "x86-64"},
{"386", "x86-32"},
{"arm64", "aarch-64"},
{"arm", ""},
{"mips", ""},
{"unknown", ""},
}
for _, tt := range tests {
t.Run(tt.goarch, func(t *testing.T) {
result := goArchToRPMISA(tt.goarch)
if result != tt.expected {
t.Errorf("goArchToRPMISA(%q) = %q, ожидается %q", tt.goarch, result, tt.expected)
}
})
}
}
func TestExtractRepoNameFromPath(t *testing.T) {
tests := []struct {
name string