Skip to content

Commit 8b84142

Browse files
authored
Use #fileID/#filePath instead of #file (swift-server#644)
1 parent 10f42e6 commit 8b84142

8 files changed

+9
-9
lines changed

Diff for: Sources/AsyncHTTPClient/AsyncAwait/Transaction+StateMachine.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ extension Transaction {
641641
private func verifyStreamIDIsEqual(
642642
registered: TransactionBody.AsyncIterator.ID,
643643
this: TransactionBody.AsyncIterator.ID,
644-
file: StaticString = #file,
644+
file: StaticString = #fileID,
645645
line: UInt = #line
646646
) {
647647
if registered != this {

Diff for: Tests/AsyncHTTPClientTests/ConnectionPoolSizeConfigValueIsRespectedTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class ConnectionPoolSizeConfigValueIsRespectedTests: XCTestCaseHTTPClientT
5252

5353
let g = DispatchGroup()
5454
for workerID in 0..<numberOfParallelWorkers {
55-
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: g) {
55+
DispatchQueue(label: "\(#fileID):\(#line):worker-\(workerID)").async(group: g) {
5656
func makeRequest() {
5757
let url = "http://127.0.0.1:\(httpBin.port)"
5858
XCTAssertNoThrow(try client.get(url: url).wait())

Diff for: Tests/AsyncHTTPClientTests/HTTPClientTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass {
10081008
let url = "http://127.0.0.1:\(server?.localAddress?.port ?? -1)/hello"
10091009
let g = DispatchGroup()
10101010
for workerID in 0..<numberOfParallelWorkers {
1011-
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: g) {
1011+
DispatchQueue(label: "\(#fileID):\(#line):worker-\(workerID)").async(group: g) {
10121012
func makeRequest() {
10131013
XCTAssertNoThrow(try self.defaultClient.get(url: url).wait())
10141014
}

Diff for: Tests/AsyncHTTPClientTests/HTTPConnectionPool+HTTP2StateMachineTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ class HTTPConnectionPool_HTTP2StateMachineTests: XCTestCase {
13311331
func XCTAssertEqualTypeAndValue<Left, Right: Equatable>(
13321332
_ lhs: @autoclosure () throws -> Left,
13331333
_ rhs: @autoclosure () throws -> Right,
1334-
file: StaticString = #file,
1334+
file: StaticString = #filePath,
13351335
line: UInt = #line
13361336
) {
13371337
XCTAssertNoThrow(try {

Diff for: Tests/AsyncHTTPClientTests/HTTPConnectionPoolTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class HTTPConnectionPoolTests: XCTestCase {
419419

420420
let dispatchGroup = DispatchGroup()
421421
for workerID in 0..<numberOfParallelWorkers {
422-
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: dispatchGroup) {
422+
DispatchQueue(label: "\(#filePath):\(#line):worker-\(workerID)").async(group: dispatchGroup) {
423423
func makeRequest() {
424424
let url = "http://localhost:\(httpBin.port)"
425425
var maybeRequest: HTTPClient.Request?

Diff for: Tests/AsyncHTTPClientTests/HTTPRequestStateMachineTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ extension HTTPRequestStateMachine.Action {
746746
fileprivate func assertFailRequest<Error>(
747747
_ expectedError: Error,
748748
_ expectedFinalStreamAction: HTTPRequestStateMachine.Action.FinalFailedRequestAction,
749-
file: StaticString = #file,
749+
file: StaticString = #filePath,
750750
line: UInt = #line
751751
) where Error: Swift.Error & Equatable {
752752
guard case .failRequest(let actualError, let actualFinalStreamAction) = self else {

Diff for: Tests/AsyncHTTPClientTests/SOCKSTestUtils.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class MockSOCKSServer {
4040
self.channel.localAddress!.port!
4141
}
4242

43-
init(expectedURL: String, expectedResponse: String, misbehave: Bool = false, file: String = #file, line: UInt = #line) throws {
43+
init(expectedURL: String, expectedResponse: String, misbehave: Bool = false, file: String = #filePath, line: UInt = #line) throws {
4444
let elg = MultiThreadedEventLoopGroup(numberOfThreads: 1)
4545
let bootstrap: ServerBootstrap
4646
if misbehave {

Diff for: Tests/AsyncHTTPClientTests/XCTest+AsyncAwait.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension XCTestCase {
6565
internal func XCTAssertThrowsError<T>(
6666
_ expression: @autoclosure () async throws -> T,
6767
verify: (Error) -> Void = { _ in },
68-
file: StaticString = #file,
68+
file: StaticString = #filePath,
6969
line: UInt = #line
7070
) async {
7171
do {
@@ -79,7 +79,7 @@ internal func XCTAssertThrowsError<T>(
7979
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
8080
internal func XCTAssertNoThrowWithResult<Result>(
8181
_ expression: @autoclosure () async throws -> Result,
82-
file: StaticString = #file,
82+
file: StaticString = #filePath,
8383
line: UInt = #line
8484
) async -> Result? {
8585
do {

0 commit comments

Comments
 (0)