Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Sources/Services/ContainerAPIService/Client/Arch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum Arch: String {

public init?(rawValue: String) {
switch rawValue.lowercased() {
case "arm64":
case "arm64", "aarch64":
self = .arm64
case "amd64", "x86_64", "x86-64":
self = .amd64
Expand Down
7 changes: 7 additions & 0 deletions Tests/ContainerAPIClientTests/ArchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,17 @@ struct ArchTests {
#expect(arch == .arm64)
}

@Test func testAarch64Alias() throws {
let arch = Arch(rawValue: "aarch64")
#expect(arch != nil)
#expect(arch == .arm64)
}

@Test func testCaseInsensitive() throws {
#expect(Arch(rawValue: "AMD64") == .amd64)
#expect(Arch(rawValue: "X86_64") == .amd64)
#expect(Arch(rawValue: "ARM64") == .arm64)
#expect(Arch(rawValue: "AARCH64") == .arm64)
#expect(Arch(rawValue: "Amd64") == .amd64)
}

Expand Down