Skip to content

Commit 27b74ed

Browse files
authored
Merge pull request swiftlang#2636 from rintaro/xctest-filepath
[Tests] Use '#filePath' as default argument instead of '#file'
2 parents d643ebb + 6f1ad77 commit 27b74ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SwiftCompilerPluginTest/JSONTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ final class JSONTests: XCTestCase {
185185
private func assertRoundTrip<T: Codable & Equatable>(
186186
of value: T,
187187
expectedJSON: String,
188-
file: StaticString = #file,
188+
file: StaticString = #filePath,
189189
line: UInt = #line
190190
) {
191191
let payload: [UInt8]
@@ -214,7 +214,7 @@ final class JSONTests: XCTestCase {
214214
private func assertRoundTripTypeCoercionFailure<T: Codable, U: Codable>(
215215
of value: T,
216216
as type: U.Type,
217-
file: StaticString = #file,
217+
file: StaticString = #filePath,
218218
line: UInt = #line
219219
) {
220220
do {
@@ -228,15 +228,15 @@ final class JSONTests: XCTestCase {
228228
}
229229
}
230230

231-
private func assertInvalidStrng(_ json: String, file: StaticString = #file, line: UInt = #line) {
231+
private func assertInvalidStrng(_ json: String, file: StaticString = #filePath, line: UInt = #line) {
232232
do {
233233
var json = json
234234
_ = try json.withUTF8 { try JSON.decode(String.self, from: $0) }
235235
XCTFail("decoding should fail", file: file, line: line)
236236
} catch {}
237237
}
238238

239-
private func assertParseError(_ json: String, message: String, file: StaticString = #file, line: UInt = #line) {
239+
private func assertParseError(_ json: String, message: String, file: StaticString = #filePath, line: UInt = #line) {
240240
do {
241241
var json = json
242242
_ = try json.withUTF8 { try JSON.decode(Bool.self, from: $0) }

0 commit comments

Comments
 (0)