From 30a123c851402b5c7ff6be21a1846731bc9c5055 Mon Sep 17 00:00:00 2001 From: vitalii p Date: Sat, 21 Oct 2023 23:44:47 +0300 Subject: [PATCH] fixed tests for macos 13 --- .../SystemSettingsAccessProtocolTests.swift | 6 +++++- .../SystemSettingsNetworkTest.swift | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Tests/SystemSettingsAccessTests/SystemSettingsAccessProtocolTests.swift b/Tests/SystemSettingsAccessTests/SystemSettingsAccessProtocolTests.swift index b0db3bd..e4f25de 100644 --- a/Tests/SystemSettingsAccessTests/SystemSettingsAccessProtocolTests.swift +++ b/Tests/SystemSettingsAccessTests/SystemSettingsAccessProtocolTests.swift @@ -7,7 +7,11 @@ final class SystemSettingsAccessProtocolTests: XCTestCase { } func testPath_failed() throws { - XCTAssertNotNil(SystemSettingsFailedMock.test.path) + if #available(macOS 14.0, *) { + XCTAssertNotNil(SystemSettingsFailedMock.test.path) + } else { + XCTAssertNil(SystemSettingsFailedMock.test.path) + } } func testPath_internal_failed() throws { diff --git a/Tests/SystemSettingsAccessTests/SystemSettingsNetworkTest.swift b/Tests/SystemSettingsAccessTests/SystemSettingsNetworkTest.swift index 96a8bd1..8fbfacb 100644 --- a/Tests/SystemSettingsAccessTests/SystemSettingsNetworkTest.swift +++ b/Tests/SystemSettingsAccessTests/SystemSettingsNetworkTest.swift @@ -7,7 +7,16 @@ final class SystemSettingsNetworkTest: XCTestCase { for key in SystemSettingsNetwork.allCases { XCTAssertFalse(String(describing: key).isEmpty) XCTAssertFalse(key.rawValue.isEmpty) - XCTAssertNotNil(key.path) + if #available(macOS 14.0, *) { + XCTAssertNotNil(key.path) + } else { + let ignoreList: [SystemSettingsNetwork] = [.wifi, .ethernetDetails, .modemDetails, .vpnDetails, .vpnOnDemand] + if ignoreList.contains(key) { + XCTAssertNil(key.path) + } else { + XCTAssertNotNil(key.path) + } + } } } }