Skip to content

Commit

Permalink
Only use URLSession.shared.data in Swift 6.0 or above
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Aug 1, 2024
1 parent 53553d0 commit 3965939
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/JMESPathTests/ComplianceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ final class ComplianceTests: XCTestCase {
}

func testCompliance(url: URL, ignoring: [String] = []) async throws {
let (data, _) = try await URLSession.shared.data(from: url, delegate: nil)
#if swift(>=6.0)
let (data, _) = try await URLSession.shared.data(from: url, delegate: nil)
#else
let data = try Data(contentsOf: url)
#endif
let tests = try JSONDecoder().decode([ComplianceTest].self, from: data)

if #available(iOS 11.0, tvOS 11.0, watchOS 5.0, *) {
Expand Down

0 comments on commit 3965939

Please sign in to comment.