diff --git a/Sources/XcodesKit/Version+Xcode.swift b/Sources/XcodesKit/Version+Xcode.swift index 26aa9e1..af8e279 100644 --- a/Sources/XcodesKit/Version+Xcode.swift +++ b/Sources/XcodesKit/Version+Xcode.swift @@ -43,6 +43,8 @@ public extension Version { optionalPrereleaseIdentifiers[lastIndex] = "\(lastItem)-seed" } + } else if type == "b" { + optionalPrereleaseIdentifiers.append("beta") } else { optionalPrereleaseIdentifiers.append(type) } diff --git a/Tests/XcodesKitTests/Models+FirstWithVersionTests.swift b/Tests/XcodesKitTests/Models+FirstWithVersionTests.swift index 489b9be..df6d8dd 100644 --- a/Tests/XcodesKitTests/Models+FirstWithVersionTests.swift +++ b/Tests/XcodesKitTests/Models+FirstWithVersionTests.swift @@ -91,6 +91,10 @@ final class ModelsFirstWithVersionTests: XCTestCase { installedXcodes.first(withVersion: Version(xcodeVersion: "1.2.3 Beta 2")!), InstalledXcode(path: Path("/Applications/Xcode-1.2.3-beta.2.app")!, version: Version(xcodeVersion: "1.2.3 Beta 2")!) ) + XCTAssertEqual( + installedXcodes.first(withVersion: Version(xcodeVersion: "1.2.3b2")!), + InstalledXcode(path: Path("/Applications/Xcode-1.2.3-beta.2.app")!, version: Version(xcodeVersion: "1.2.3 Beta 2")!) + ) // With build metadata XCTAssertEqual(