From 54c727e0b069ffda7f80db7af99bfab2518e0780 Mon Sep 17 00:00:00 2001 From: leogdion Date: Fri, 8 Mar 2024 20:53:49 -0500 Subject: [PATCH] Adding Concurrency Checks and Fixes (#12) --- .github/workflows/FelinePine.yml | 25 ++++++-- .swiftformat | 4 +- .swiftlint.yml | 7 --- Mintfile | 4 +- Package.swift | 11 ++++ Scripts/lint.sh | 4 +- Sources/FelinePine/Feline.swift | 29 +++++++++ Sources/FelinePine/Loggable.swift | 29 +++++++++ .../FelinePine/Logger+LoggerCategory.swift | 29 +++++++++ Sources/FelinePine/Logger.swift | 30 +++++++++ Sources/FelinePine/LoggingSystem.swift | 62 ++++++++++++++++--- Sources/FelinePine/NSLocking.swift | 42 +++++++++++++ Sources/FelinePine/Pine.swift | 29 +++++++++ Tests/FelinePineTests/FelinePineTests.swift | 30 +++++++++ .../FelinePineTests/LoggingSystemTests.swift | 29 +++++++++ Tests/FelinePineTests/Mocks/MockSystem.swift | 29 +++++++++ Tests/FelinePineTests/Mocks/MockType.swift | 29 +++++++++ 17 files changed, 394 insertions(+), 28 deletions(-) create mode 100644 Sources/FelinePine/NSLocking.swift diff --git a/.github/workflows/FelinePine.yml b/.github/workflows/FelinePine.yml index ad7baf6..dd731a5 100644 --- a/.github/workflows/FelinePine.yml +++ b/.github/workflows/FelinePine.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: runs-on: [ubuntu-20.04, ubuntu-22.04] - swift-version: [5.8.1, 5.9] + swift-version: [5.8.1, 5.9, "5.10"] steps: - uses: actions/checkout@v3 - name: Cache swift package modules @@ -70,17 +70,30 @@ jobs: strategy: matrix: include: - - xcode: "/Applications/Xcode_14.3.1.app" + - runs-on: macos-13 + xcode: "/Applications/Xcode_14.3.1.app" iOSVersion: "16.4" watchOSVersion: "9.4" - watchName: "Apple Watch Ultra (49mm)" - iPhoneName: "iPhone 14 Pro Max" + watchName: "Apple Watch Series 5 (40mm)" + iPhoneName: "iPhone 14" - runs-on: macos-13 xcode: "/Applications/Xcode_15.0.1.app" iOSVersion: "17.0.1" watchOSVersion: "10.0" - watchName: "Apple Watch Ultra (49mm)" - iPhoneName: "iPhone 15 Pro Max" + watchName: "Apple Watch Series 8 (41mm)" + iPhoneName: "iPhone 15" + - runs-on: macos-14 + xcode: "/Applications/Xcode_15.1.app" + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Series 9 (41mm)" + iPhoneName: "iPhone 15 Plus" + - runs-on: macos-14 + xcode: "/Applications/Xcode_15.2.app" + iOSVersion: "17.2" + watchOSVersion: "10.2" + watchName: "Apple Watch Series 9 (45mm)" + iPhoneName: "iPhone 15 Pro" steps: - uses: actions/checkout@v3 - name: Cache swift package modules diff --git a/.swiftformat b/.swiftformat index c43ce88..d31b795 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,7 +1,7 @@ --indent 2 ---header strip +--header "\n {file}.swift\n FelinePine\n\n Created by Leo Dion.\n Copyright © {year} BrightDigit.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the “Software”), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or\n sell copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n \n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n" --commas inline ---disable wrapMultilineStatementBraces +--disable wrapMultilineStatementBraces, redundantInternal --extensionacl on-declarations --decimalgrouping 3,4 --exclude .build, DerivedData, Sample \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml index 4771f70..1b8978b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,5 +1,4 @@ opt_in_rules: - - anyobject_protocol - array_init - attributes - closure_body_length @@ -22,11 +21,9 @@ opt_in_rules: - expiring_todo - explicit_acl - explicit_init - - explicit_self - explicit_top_level_acl - fallthrough - fatal_error_message - - file_header - file_name - file_name_no_space - file_types_order @@ -46,7 +43,6 @@ opt_in_rules: - lower_acl_than_parent - missing_docs - modifier_order - #- multiline_arguments - multiline_arguments_brackets - multiline_function_chains - multiline_literal_brackets @@ -82,13 +78,10 @@ opt_in_rules: - strong_iboutlet - switch_case_on_newline - toggle_bool - #- trailing_closure - type_contents_order - unavailable_function - unneeded_parentheses_in_closure_argument - unowned_variable_capture - - unused_declaration - - unused_import - vertical_parameter_alignment_on_call - vertical_whitespace_between_cases - vertical_whitespace_closing_braces diff --git a/Mintfile b/Mintfile index 2777f4d..044fc70 100644 --- a/Mintfile +++ b/Mintfile @@ -1,3 +1,3 @@ -nicklockwood/SwiftFormat@0.47.0 -realm/SwiftLint@0.41.0 +nicklockwood/SwiftFormat@0.52.11 +realm/SwiftLint@0.54.0 peripheryapp/periphery@2.12.3 \ No newline at end of file diff --git a/Package.swift b/Package.swift index 28e24bc..006f7a9 100644 --- a/Package.swift +++ b/Package.swift @@ -24,6 +24,16 @@ let package = Package( package: "swift-log", condition: .when(platforms: [.linux, .android, .wasi, .windows]) ) + ], + swiftSettings: [ + SwiftSetting.enableUpcomingFeature("BareSlashRegexLiterals"), + SwiftSetting.enableUpcomingFeature("ConciseMagicFile"), + SwiftSetting.enableUpcomingFeature("ExistentialAny"), + SwiftSetting.enableUpcomingFeature("ForwardTrailingClosures"), + SwiftSetting.enableUpcomingFeature("ImplicitOpenExistentials"), + SwiftSetting.enableUpcomingFeature("StrictConcurrency"), + SwiftSetting.enableUpcomingFeature("DisableOutwardActorInference"), + SwiftSetting.enableExperimentalFeature("StrictConcurrency") ] ), .testTarget( @@ -32,3 +42,4 @@ let package = Package( ) ] ) +// swiftlint:enable explicit_acl explicit_top_level_acl diff --git a/Scripts/lint.sh b/Scripts/lint.sh index c9fd9e5..aabd316 100755 --- a/Scripts/lint.sh +++ b/Scripts/lint.sh @@ -35,10 +35,10 @@ pushd $PACKAGE_DIR if [ -z "$CI" ]; then $MINT_RUN swiftformat . - $MINT_RUN swiftlint autocorrect + $MINT_RUN swiftlint --autocorrect fi -$MINT_RUN periphery scan +$MINT_RUN periphery scan --disable-update-check $MINT_RUN swiftformat --lint $SWIFTFORMAT_OPTIONS . $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS diff --git a/Sources/FelinePine/Feline.swift b/Sources/FelinePine/Feline.swift index c852884..d3988da 100644 --- a/Sources/FelinePine/Feline.swift +++ b/Sources/FelinePine/Feline.swift @@ -1,3 +1,32 @@ +// +// Feline.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + import Foundation #if canImport(os) import os diff --git a/Sources/FelinePine/Loggable.swift b/Sources/FelinePine/Loggable.swift index be544c5..5df87be 100644 --- a/Sources/FelinePine/Loggable.swift +++ b/Sources/FelinePine/Loggable.swift @@ -1,3 +1,32 @@ +// +// Loggable.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + import Foundation /// Loggable type for a ``LoggingSystem``. diff --git a/Sources/FelinePine/Logger+LoggerCategory.swift b/Sources/FelinePine/Logger+LoggerCategory.swift index be16bda..60bd45a 100644 --- a/Sources/FelinePine/Logger+LoggerCategory.swift +++ b/Sources/FelinePine/Logger+LoggerCategory.swift @@ -1,3 +1,32 @@ +// +// Logger+LoggerCategory.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + import Foundation #if canImport(os) import os diff --git a/Sources/FelinePine/Logger.swift b/Sources/FelinePine/Logger.swift index f7dda9a..1088c4c 100644 --- a/Sources/FelinePine/Logger.swift +++ b/Sources/FelinePine/Logger.swift @@ -1,3 +1,32 @@ +// +// Logger.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + // swiftlint:disable file_types_order #if canImport(os) @@ -9,3 +38,4 @@ /// swift-log Logging.Logger public typealias Logger = Logging.Logger #endif +// swiftlint:enable file_types_order diff --git a/Sources/FelinePine/LoggingSystem.swift b/Sources/FelinePine/LoggingSystem.swift index 8d213e2..85b051e 100644 --- a/Sources/FelinePine/LoggingSystem.swift +++ b/Sources/FelinePine/LoggingSystem.swift @@ -1,3 +1,32 @@ +// +// LoggingSystem.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + import Foundation #if canImport(os) import os @@ -5,24 +34,39 @@ import Foundation import Logging #endif -private enum LoggingSystemRepository { - static var items = [String: Any]() - static func loggingSystem( +// swiftlint:disable strict_fileprivate +private class LoggingSystemRepository: @unchecked Sendable { + fileprivate static let shared = LoggingSystemRepository() + + private let lock = NSRecursiveLock() + private var items = [String: Any]() + + private init(items: [String: Any] = [String: Any]()) { + self.items = items + } + + fileprivate func loggingSystem( for system: LoggingSystemType.Type, using value: @autoclosure () -> [LoggingSystemType.Category: Logger] ) -> [LoggingSystemType.Category: Logger] { - let anyItem = items[system.identifier] + let anyItem = lock.withLock { + items[system.identifier] + } if let item = anyItem as? [LoggingSystemType.Category: Logger] { return item } else { assert(anyItem == nil) - let value = value() - items[system.identifier] = value - return value + return lock.withLock { + let value = value() + items[system.identifier] = value + return value + } } } } +// swiftlint:enable strict_fileprivate + /// Defines the logging categories for your application. public protocol LoggingSystem { /// Logging categories available to types in the application @@ -59,13 +103,13 @@ extension LoggingSystem { extension LoggingSystem where Category: CaseIterable { private static var loggers: [Category: Logger] { - LoggingSystemRepository.loggingSystem(for: Self.self, using: defaultLoggers()) + LoggingSystemRepository.shared.loggingSystem(for: Self.self, using: defaultLoggers()) } /// If ``Category`` implements `CaseIterable`, ``LoggingSystem`` can automatically /// iterate over the cases and automatically create the ``Logger`` objects needed. public static func logger(forCategory category: Category) -> Logger { - guard let logger = Self.loggers[category] else { + guard let logger = loggers[category] else { preconditionFailure("missing logger") } return logger diff --git a/Sources/FelinePine/NSLocking.swift b/Sources/FelinePine/NSLocking.swift new file mode 100644 index 0000000..7d6e180 --- /dev/null +++ b/Sources/FelinePine/NSLocking.swift @@ -0,0 +1,42 @@ +// +// NSLocking.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +import Foundation + +#if !canImport(os) + extension NSLocking { + internal func withLock(_ body: () throws -> R) rethrows -> R { + lock() + defer { + self.unlock() + } + return try body() + } + } +#endif diff --git a/Sources/FelinePine/Pine.swift b/Sources/FelinePine/Pine.swift index 336cdcb..ec0a6f3 100644 --- a/Sources/FelinePine/Pine.swift +++ b/Sources/FelinePine/Pine.swift @@ -1,3 +1,32 @@ +// +// Pine.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + import Foundation #if canImport(os) import os diff --git a/Tests/FelinePineTests/FelinePineTests.swift b/Tests/FelinePineTests/FelinePineTests.swift index 86ca842..1e19810 100644 --- a/Tests/FelinePineTests/FelinePineTests.swift +++ b/Tests/FelinePineTests/FelinePineTests.swift @@ -1,8 +1,38 @@ +// +// FelinePineTests.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + @testable import FelinePine import XCTest internal final class FelinePineTests: XCTestCase { internal func testLogger() { _ = MockType.logger + XCTAssert(true) } } diff --git a/Tests/FelinePineTests/LoggingSystemTests.swift b/Tests/FelinePineTests/LoggingSystemTests.swift index 81da581..b654a6e 100644 --- a/Tests/FelinePineTests/LoggingSystemTests.swift +++ b/Tests/FelinePineTests/LoggingSystemTests.swift @@ -1,3 +1,32 @@ +// +// LoggingSystemTests.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + @testable import FelinePine import XCTest diff --git a/Tests/FelinePineTests/Mocks/MockSystem.swift b/Tests/FelinePineTests/Mocks/MockSystem.swift index 31bde43..6e9fceb 100644 --- a/Tests/FelinePineTests/Mocks/MockSystem.swift +++ b/Tests/FelinePineTests/Mocks/MockSystem.swift @@ -1,3 +1,32 @@ +// +// MockSystem.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + @testable import FelinePine import XCTest diff --git a/Tests/FelinePineTests/Mocks/MockType.swift b/Tests/FelinePineTests/Mocks/MockType.swift index 447b8dc..3379ad6 100644 --- a/Tests/FelinePineTests/Mocks/MockType.swift +++ b/Tests/FelinePineTests/Mocks/MockType.swift @@ -1,3 +1,32 @@ +// +// MockType.swift +// FelinePine +// +// Created by Leo Dion. +// Copyright © 2024 BrightDigit. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + @testable import FelinePine import XCTest