Skip to content

Commit

Permalink
Add more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Oct 13, 2024
1 parent b6eba5d commit 50bbd37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/AppleMapsKit/AppleMapsKitError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public struct AppleMapsKitError: Error, Sendable {

extension AppleMapsKitError: CustomStringConvertible {
public var description: String {
"AppleMapsKitError(errorType: \(self.errorType)"
"AppleMapsKitError(errorType: \(self.errorType))"
}
}
9 changes: 9 additions & 0 deletions Tests/AppleMapsKitTests/AppleMapsKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ struct AppleMapsKitTests {
)
let arrivalRoutes = try #require(arrivalDirections.routes)
#expect(!arrivalRoutes.isEmpty)

Check warning on line 167 in Tests/AppleMapsKitTests/AppleMapsKitTests.swift

View check run for this annotation

Codecov / codecov/patch

Tests/AppleMapsKitTests/AppleMapsKitTests.swift#L166-L167

Added lines #L166 - L167 were not covered by tests
} when: {
credentialsAreInvalid
}

try await withKnownIssue {
let departureDirections = try await client.directions(
from: "37.7857,-122.4011",
to: "San Francisco City Hall, CA",
Expand Down Expand Up @@ -248,4 +252,9 @@ struct AppleMapsKitTests {
credentialsAreInvalid
}
}

@Test("AppleMapsKitError") func appleMapsKitError() {
#expect(AppleMapsKitError.noPlacesFound.description == "AppleMapsKitError(errorType: noPlacesFound)")
#expect(AppleMapsKitError.invalidSearchResultType.description == "AppleMapsKitError(errorType: invalidSearchResultType)")
}
}

0 comments on commit 50bbd37

Please sign in to comment.