diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b61be3e..04755183 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer jobs: build-test: @@ -68,13 +68,13 @@ jobs: matrix: include: - name: iOS - destination: platform=iOS Simulator,name=iPhone 16,OS=18.0 + destination: platform=iOS Simulator,name=iPhone 16,OS=18.2 - name: watchOS - destination: platform=watchOS Simulator,name=Apple Watch Series 10 (46mm),OS=11.0 + destination: platform=watchOS Simulator,name=Apple Watch Series 10 (46mm),OS=11.2 - name: tvOS - destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.0 + destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=18.2 - name: visionOS - destination: platform=visionOS Simulator,name=Apple Vision Pro,OS=2.0 + destination: platform=visionOS Simulator,name=Apple Vision Pro,OS=2.2 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5ef0536d..ac962d7f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer jobs: analyze: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e9cbe263..d829917e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -26,7 +26,7 @@ jobs: build: name: Build runs-on: ubuntu-latest - container: swift:6.0-jammy + container: swift:6.0.2-jammy steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7020405a..6da04571 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,7 +20,7 @@ concurrency: cancel-in-progress: true env: - DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer jobs: integration-test: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b6d5a4a9..0faaf719 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true env: - DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer jobs: swiftFormat: diff --git a/Sources/TMDb/Domain/Models/FacebookLink.swift b/Sources/TMDb/Domain/Models/FacebookLink.swift index be586582..d43213fb 100644 --- a/Sources/TMDb/Domain/Models/FacebookLink.swift +++ b/Sources/TMDb/Domain/Models/FacebookLink.swift @@ -44,6 +44,7 @@ public struct FacebookLink: ExternalLink { public init?(facebookID: String?) { guard let facebookID, + !facebookID.isEmpty, let url = Self.facebookURL(for: facebookID) else { return nil diff --git a/Sources/TMDb/Domain/Models/IMDbLink.swift b/Sources/TMDb/Domain/Models/IMDbLink.swift index 6f776b1a..5117d6af 100644 --- a/Sources/TMDb/Domain/Models/IMDbLink.swift +++ b/Sources/TMDb/Domain/Models/IMDbLink.swift @@ -64,6 +64,7 @@ public struct IMDbLink: ExternalLink { public init?(imdbNameID: String?) { guard let imdbNameID, + !imdbNameID.isEmpty, let url = Self.imdbURL(forName: imdbNameID) else { return nil diff --git a/Sources/TMDb/Domain/Models/InstagramLink.swift b/Sources/TMDb/Domain/Models/InstagramLink.swift index ae209ff2..9be98be5 100644 --- a/Sources/TMDb/Domain/Models/InstagramLink.swift +++ b/Sources/TMDb/Domain/Models/InstagramLink.swift @@ -44,6 +44,7 @@ public struct InstagramLink: ExternalLink { public init?(instagramID: String?) { guard let instagramID, + !instagramID.isEmpty, let url = Self.instagramURL(for: instagramID) else { return nil diff --git a/Sources/TMDb/Domain/Models/TikTokLink.swift b/Sources/TMDb/Domain/Models/TikTokLink.swift index 6a0b2565..4bd0a8a6 100644 --- a/Sources/TMDb/Domain/Models/TikTokLink.swift +++ b/Sources/TMDb/Domain/Models/TikTokLink.swift @@ -44,6 +44,7 @@ public struct TikTokLink: ExternalLink { public init?(tikTokID: String?) { guard let tikTokID, + !tikTokID.isEmpty, let url = Self.tikTokURL(for: tikTokID) else { return nil diff --git a/Sources/TMDb/Domain/Models/TwitterLink.swift b/Sources/TMDb/Domain/Models/TwitterLink.swift index 0a9003c0..3296061e 100644 --- a/Sources/TMDb/Domain/Models/TwitterLink.swift +++ b/Sources/TMDb/Domain/Models/TwitterLink.swift @@ -44,6 +44,7 @@ public struct TwitterLink: ExternalLink { public init?(twitterID: String?) { guard let twitterID, + !twitterID.isEmpty, let url = Self.twitterURL(for: twitterID) else { return nil diff --git a/Sources/TMDb/Domain/Models/WikiDataLink.swift b/Sources/TMDb/Domain/Models/WikiDataLink.swift index 36bf4129..310e723d 100644 --- a/Sources/TMDb/Domain/Models/WikiDataLink.swift +++ b/Sources/TMDb/Domain/Models/WikiDataLink.swift @@ -44,6 +44,7 @@ public struct WikiDataLink: ExternalLink { public init?(wikiDataID: String?) { guard let wikiDataID, + !wikiDataID.isEmpty, let url = Self.wikiDataURL(for: wikiDataID) else { return nil diff --git a/Sources/TMDb/Domain/Services/People/TMDbPersonService.swift b/Sources/TMDb/Domain/Services/People/TMDbPersonService.swift index d8b81124..95ffa026 100644 --- a/Sources/TMDb/Domain/Services/People/TMDbPersonService.swift +++ b/Sources/TMDb/Domain/Services/People/TMDbPersonService.swift @@ -115,8 +115,9 @@ final class TMDbPersonService: PersonService { return personList } - func externalLinks(forPerson personID: Person.ID) async throws -> PersonExternalLinksCollection - { + func externalLinks( + forPerson personID: Person.ID + ) async throws -> PersonExternalLinksCollection { let request = PersonExternalLinksRequest(id: personID) let linksCollection: PersonExternalLinksCollection diff --git a/Tests/TMDbTests/Domain/Models/FacebookLinkTests.swift b/Tests/TMDbTests/Domain/Models/FacebookLinkTests.swift index 5afc834f..af8af1e6 100644 --- a/Tests/TMDbTests/Domain/Models/FacebookLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/FacebookLinkTests.swift @@ -32,6 +32,13 @@ struct FacebookLinkTests { #expect(facebookLink == nil) } + @Test("Init with Facebook ID when ID is empty string returns nil") + func initWithFacebookIDWhenIDIsEmptyStringReturnsNil() { + let facebookLink = FacebookLink(facebookID: "") + + #expect(facebookLink == nil) + } + @Test("Facebook URL") func testURL() throws { let facebookID = "BarbieTheMovie" diff --git a/Tests/TMDbTests/Domain/Models/IMDbLinkTests.swift b/Tests/TMDbTests/Domain/Models/IMDbLinkTests.swift index edb03486..a62900b7 100644 --- a/Tests/TMDbTests/Domain/Models/IMDbLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/IMDbLinkTests.swift @@ -39,6 +39,13 @@ struct IMDbLinkTests { #expect(imdbLink == nil) } + @Test("init with IMDB name ID when ID is empty string returns nil") + func initWithIMDbNameIDWhenIDIsEmptyStringReturnsNil() { + let imdbLink = IMDbLink(imdbNameID: "") + + #expect(imdbLink == nil) + } + @Test("URL when using title ID returns show URL") func urlWhenUsingTitleIDReturnsShowURL() throws { let imdbID = "tt1517268" diff --git a/Tests/TMDbTests/Domain/Models/InstagramLinkTests.swift b/Tests/TMDbTests/Domain/Models/InstagramLinkTests.swift index 7c98f8be..e6716751 100644 --- a/Tests/TMDbTests/Domain/Models/InstagramLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/InstagramLinkTests.swift @@ -32,6 +32,13 @@ struct InstagramLinkTests { #expect(instagramLink == nil) } + @Test("init with instagramID when ID is empty string returns nil") + func initWithInstagramIDWhenIDIsEmptyStringReturnsNil() { + let instagramLink = InstagramLink(instagramID: "") + + #expect(instagramLink == nil) + } + @Test("URL returns post URL") func urlReturnsPostURL() throws { let instagramID = "barbiethemovie" diff --git a/Tests/TMDbTests/Domain/Models/TikTokLinkTests.swift b/Tests/TMDbTests/Domain/Models/TikTokLinkTests.swift index 7bee8427..0521a064 100644 --- a/Tests/TMDbTests/Domain/Models/TikTokLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/TikTokLinkTests.swift @@ -32,6 +32,13 @@ struct TikTokLinkTests { #expect(tikTokLink == nil) } + @Test("init with TikTok ID when ID is empty string returns nil") + func initWithTikTokIDWhenIDIsEmptyStringReturnsNil() { + let tikTokLink = TikTokLink(tikTokID: "") + + #expect(tikTokLink == nil) + } + @Test("url returns TikTok URL") func urlReturnsTikTokURL() throws { let tikTokID = "jasonstatham" diff --git a/Tests/TMDbTests/Domain/Models/TwitterLinkTests.swift b/Tests/TMDbTests/Domain/Models/TwitterLinkTests.swift index 545d60cb..82caee6a 100644 --- a/Tests/TMDbTests/Domain/Models/TwitterLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/TwitterLinkTests.swift @@ -32,6 +32,13 @@ struct TwitterLinkTests { #expect(twitterLint == nil) } + @Test("init with twitterID when ID is empty string returns nil") + func initWithTwitterIDWhenIDIsEmptyStringReturnsNil() { + let twitterLint = TwitterLink(twitterID: "") + + #expect(twitterLint == nil) + } + @Test("url returns Twitter URL") func urlReturnsTwitterURL() throws { let twitterID = "barbiethemovie" diff --git a/Tests/TMDbTests/Domain/Models/WikiDataLinkTests.swift b/Tests/TMDbTests/Domain/Models/WikiDataLinkTests.swift index f404fea1..38d55b4b 100644 --- a/Tests/TMDbTests/Domain/Models/WikiDataLinkTests.swift +++ b/Tests/TMDbTests/Domain/Models/WikiDataLinkTests.swift @@ -32,6 +32,13 @@ struct WikiDataLinkTests { #expect(wikiDataLink == nil) } + @Test("init with wikiDataID when ID is empty string returns nil") + func initWithWikiDataIDWhenIDIsEmptyStringReturnsNil() { + let wikiDataLink = WikiDataLink(wikiDataID: "") + + #expect(wikiDataLink == nil) + } + @Test("url returns WikiData URL") func urlReturnsWikiDataURL() throws { let wikiDataID = "Q55436290"