Skip to content

[6.0] Fix build warnings in tests #2717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Tests/SwiftCompilerPluginTest/JSONTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ final class JSONTests: XCTestCase {
private func assertRoundTrip<T: Codable & Equatable>(
of value: T,
expectedJSON: String,
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) {
let payload: [UInt8]
Expand Down Expand Up @@ -214,7 +214,7 @@ final class JSONTests: XCTestCase {
private func assertRoundTripTypeCoercionFailure<T: Codable, U: Codable>(
of value: T,
as type: U.Type,
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) {
do {
Expand All @@ -228,15 +228,15 @@ final class JSONTests: XCTestCase {
}
}

private func assertInvalidStrng(_ json: String, file: StaticString = #file, line: UInt = #line) {
private func assertInvalidStrng(_ json: String, file: StaticString = #filePath, line: UInt = #line) {
do {
var json = json
_ = try json.withUTF8 { try JSON.decode(String.self, from: $0) }
XCTFail("decoding should fail", file: file, line: line)
} catch {}
}

private func assertParseError(_ json: String, message: String, file: StaticString = #file, line: UInt = #line) {
private func assertParseError(_ json: String, message: String, file: StaticString = #filePath, line: UInt = #line) {
do {
var json = json
_ = try json.withUTF8 { try JSON.decode(Bool.self, from: $0) }
Expand Down
3 changes: 2 additions & 1 deletion Tests/SwiftParserTest/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class ParserTests: ParserTestCase {
|| $0.pathExtension == "sil"
|| $0.pathExtension == "swiftinterface"
}
#if swift(>=6.0)
#if swift(>=6.0) && !canImport(Darwin)
// URL is not marked as Sendable in corelibs-foundation
nonisolated(unsafe) let fileURLs = _fileURLs
#else
let fileURLs = _fileURLs
Expand Down