From 30b84f735bc1798cbf9f956cbb24a8fc6e245593 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Mon, 10 Apr 2023 12:59:50 +0200 Subject: [PATCH] Defined the APICore library in the Libraries package for the Locations target. --- Apps/Locations/Libraries/Package.swift | 14 +++++++++++++- .../Libraries/Sources/APICore/Libraries.swift | 6 ++++++ .../Tests/APICoreTests/LibrariesTests.swift | 11 +++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Apps/Locations/Libraries/Sources/APICore/Libraries.swift create mode 100644 Apps/Locations/Libraries/Tests/APICoreTests/LibrariesTests.swift diff --git a/Apps/Locations/Libraries/Package.swift b/Apps/Locations/Libraries/Package.swift index 27b9b9e..0a0161e 100644 --- a/Apps/Locations/Libraries/Package.swift +++ b/Apps/Locations/Libraries/Package.swift @@ -15,9 +15,21 @@ let package = Package( dependencies: [], targets: [ .target( - name: "Locations", + name: "APICore", dependencies: [] ), + .target( + name: "Locations", + dependencies: [ + "APICore" + ] + ), + .testTarget( + name: "APICoreTests", + dependencies: [ + "APICore" + ] + ), .testTarget( name: "LocationsTests", dependencies: [ diff --git a/Apps/Locations/Libraries/Sources/APICore/Libraries.swift b/Apps/Locations/Libraries/Sources/APICore/Libraries.swift new file mode 100644 index 0000000..c1536b6 --- /dev/null +++ b/Apps/Locations/Libraries/Sources/APICore/Libraries.swift @@ -0,0 +1,6 @@ +public struct Libraries { + public private(set) var text = "Hello, World!" + + public init() { + } +} diff --git a/Apps/Locations/Libraries/Tests/APICoreTests/LibrariesTests.swift b/Apps/Locations/Libraries/Tests/APICoreTests/LibrariesTests.swift new file mode 100644 index 0000000..dd47066 --- /dev/null +++ b/Apps/Locations/Libraries/Tests/APICoreTests/LibrariesTests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import Libraries + +final class LibrariesTests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(Libraries().text, "Hello, World!") + } +}