diff --git a/Package.swift b/Package.swift index 06cac60..63977a0 100644 --- a/Package.swift +++ b/Package.swift @@ -6,8 +6,8 @@ import PackageDescription let package = Package( name: "MauriUtils", platforms: [ - .macOS(.v10_14), - .iOS(.v10) + .iOS(.v13), + .macOS(.v10_14) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. diff --git a/Sources/MauriUtils/Extensions/Secuences/Array+Helper.swift b/Sources/MauriUtils/Extensions/Secuences/Array+Helper.swift index cd20771..7883006 100644 --- a/Sources/MauriUtils/Extensions/Secuences/Array+Helper.swift +++ b/Sources/MauriUtils/Extensions/Secuences/Array+Helper.swift @@ -1,5 +1,5 @@ // -// File.swift +// Array+Helper.swift // // // Created by Mauricio Chirino on 05/12/20. diff --git a/Sources/MauriUtils/Helpers/XCTest+MemoryLeakTracker.swift b/Sources/MauriUtils/Helpers/XCTest+MemoryLeakTracker.swift deleted file mode 100644 index 3741644..0000000 --- a/Sources/MauriUtils/Helpers/XCTest+MemoryLeakTracker.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// XCTest+MemoryLeakTracker.swift -// -// -// Created by Mauricio Chirino on 24/4/21. -// - -import XCTest - -public extension XCTestCase { - /// Checks whether inspected object persists in memory after parent class has been deallocated. [source](https://levelup.gitconnected.com/detecting-memory-leaks-using-unit-tests-in-swift-c37533e8ee4a) - /// - Parameters: - /// - instance: class object to be inspected - /// - file: file where the offense is taking place. Defaults to current file - /// - line: specific line where the offense is taking place. Defaults to current line - func trackForMemoryLeaks(on instance: AnyObject, file: StaticString = #filePath, line: UInt = #line) { - addTeardownBlock { [weak instance] in - XCTAssertNil(instance, - "\(String(describing: instance)) should have been deallocated. Potential memory leak!", - file: file, - line: line) - } - } -} diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift deleted file mode 100644 index 0706584..0000000 --- a/Tests/LinuxMain.swift +++ /dev/null @@ -1,7 +0,0 @@ -import XCTest - -import MauriUtilsTests - -var tests = [XCTestCaseEntry]() -tests += MauriUtilsTests.allTests() -XCTMain(tests) diff --git a/Tests/MauriUtilsTests/Decoder/FileReaderTest.swift b/Tests/MauriUtilsTests/Decoder/FileReaderTest.swift index cab62bb..1f63cd8 100644 --- a/Tests/MauriUtilsTests/Decoder/FileReaderTest.swift +++ b/Tests/MauriUtilsTests/Decoder/FileReaderTest.swift @@ -40,11 +40,6 @@ final class FileReaderTest: XCTestCase { XCTAssertNotNil(localFile) } - func testNonExistingFileFromBundle() { - let localFile = fileReader.read(in: Bundle.module, from: "loremIpsum", and: .plist) - XCTAssertNil(localFile) - } - func testReadLocalFile() { let path = folderPath + fileName XCTAssertNotNil(fileReader.readAt(url: path)) diff --git a/Tests/MauriUtilsTests/Helpers/MemoryLeakTrackerTestCases.swift b/Tests/MauriUtilsTests/Helpers/MemoryLeakTrackerTestCases.swift deleted file mode 100644 index 55dc466..0000000 --- a/Tests/MauriUtilsTests/Helpers/MemoryLeakTrackerTestCases.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// MemoryLeakTrackerTestCases.swift -// -// -// Created by Mauricio Chirino on 24/4/21. -// - -@testable import MauriUtils -import XCTest - -class ParentClass { - var childs: [ChildClass] = [] -} - -class ChildClass { - weak var parentReference: ParentClass? -} - -final class MemoryLeakTrackerTestCases: XCTestCase { - func testProperTrackingForMemoryLeaks() { - // Given - let fakeParent: ParentClass? = ParentClass() - let dummyChildA: ChildClass? = ChildClass() - let dummyChildB: ChildClass? = ChildClass() - - // When - fakeParent!.childs.append(dummyChildA!) - fakeParent!.childs.append(dummyChildB!) - dummyChildA!.parentReference = fakeParent - dummyChildB!.parentReference = fakeParent - - // Verify - trackForMemoryLeaks(on: fakeParent!) - trackForMemoryLeaks(on: dummyChildA!) - trackForMemoryLeaks(on: dummyChildB!) - } -} diff --git a/Tests/MauriUtilsTests/Mock/FrameworkSetupMock.swift b/Tests/MauriUtilsTests/Mock/FrameworkSetupMock.swift index 6bb79d3..31b22f1 100644 --- a/Tests/MauriUtilsTests/Mock/FrameworkSetupMock.swift +++ b/Tests/MauriUtilsTests/Mock/FrameworkSetupMock.swift @@ -1,5 +1,5 @@ // -// File.swift +// FrameworkSetupMock.swift // // // Created by Mauricio Chirino on 06/12/20. diff --git a/Tests/MauriUtilsTests/XCTestManifests.swift b/Tests/MauriUtilsTests/XCTestManifests.swift deleted file mode 100644 index 1a4cdea..0000000 --- a/Tests/MauriUtilsTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(MauriUtilsTests.allTests), - ] -} -#endif