From 8ef416cf355ba6253d4b8539c09d00c9d792b2e8 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 12 Oct 2021 19:52:37 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=F0=9F=8F=BBAddress=20review=20comm?= =?UTF-8?q?ents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/MasKit/Models/SoftwareProduct.swift | 3 ++- Tests/MasKitTests/Models/SoftwareProductSpec.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/MasKit/Models/SoftwareProduct.swift b/Sources/MasKit/Models/SoftwareProduct.swift index c3b2860..c216bbd 100644 --- a/Sources/MasKit/Models/SoftwareProduct.swift +++ b/Sources/MasKit/Models/SoftwareProduct.swift @@ -29,7 +29,8 @@ extension SoftwareProduct { /// - Returns: true if the app is outdated; false otherwise. func isOutdatedWhenComparedTo(_ storeApp: SearchResult) -> Bool { // Only look at min OS version if we have one, also only consider macOS apps - if let osVersion = Version(storeApp.minimumOsVersion), storeApp.kind == "mac-software" { + // TODO: Replace string literal with MasStoreSearch.Entity once search branch is merged. + if let osVersion = Version(tolerant: storeApp.minimumOsVersion), storeApp.kind == "mac-software" { let requiredVersion = OperatingSystemVersion(majorVersion: osVersion.major, minorVersion: osVersion.minor, patchVersion: osVersion.patch) // Don't consider an app outdated if the version in the app store requires a higher OS version. diff --git a/Tests/MasKitTests/Models/SoftwareProductSpec.swift b/Tests/MasKitTests/Models/SoftwareProductSpec.swift index 40b05ef..2f192a7 100644 --- a/Tests/MasKitTests/Models/SoftwareProductSpec.swift +++ b/Tests/MasKitTests/Models/SoftwareProductSpec.swift @@ -26,7 +26,7 @@ public class SoftwareProductSpec: QuickSpec { let higherOs = SearchResult(kind: "mac-software", minimumOsVersion: "99.0.0", version: "3.0.0") let updateIos = SearchResult(kind: "software", minimumOsVersion: "99.0.0", version: "3.0.0") - it("is not outdated there is no new version available") { + it("is not outdated when there is no new version available") { expect(app.isOutdatedWhenComparedTo(currentApp)) == false } it("is outdated when there is a new version available") {