Skip to content

Use #fileID/#filePath instead of #file #644

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 2 commits into from
Nov 4, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ extension Transaction {
private func verifyStreamIDIsEqual(
registered: TransactionBody.AsyncIterator.ID,
this: TransactionBody.AsyncIterator.ID,
file: StaticString = #file,
file: StaticString = #fileID,
line: UInt = #line
) {
if registered != this {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class ConnectionPoolSizeConfigValueIsRespectedTests: XCTestCaseHTTPClientT

let g = DispatchGroup()
for workerID in 0..<numberOfParallelWorkers {
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: g) {
DispatchQueue(label: "\(#fileID):\(#line):worker-\(workerID)").async(group: g) {
func makeRequest() {
let url = "http://127.0.0.1:\(httpBin.port)"
XCTAssertNoThrow(try client.get(url: url).wait())
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/HTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass {
let url = "http://127.0.0.1:\(server?.localAddress?.port ?? -1)/hello"
let g = DispatchGroup()
for workerID in 0..<numberOfParallelWorkers {
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: g) {
DispatchQueue(label: "\(#fileID):\(#line):worker-\(workerID)").async(group: g) {
func makeRequest() {
XCTAssertNoThrow(try self.defaultClient.get(url: url).wait())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ class HTTPConnectionPool_HTTP2StateMachineTests: XCTestCase {
func XCTAssertEqualTypeAndValue<Left, Right: Equatable>(
_ lhs: @autoclosure () throws -> Left,
_ rhs: @autoclosure () throws -> Right,
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) {
XCTAssertNoThrow(try {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/HTTPConnectionPoolTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class HTTPConnectionPoolTests: XCTestCase {

let dispatchGroup = DispatchGroup()
for workerID in 0..<numberOfParallelWorkers {
DispatchQueue(label: "\(#file):\(#line):worker-\(workerID)").async(group: dispatchGroup) {
DispatchQueue(label: "\(#filePath):\(#line):worker-\(workerID)").async(group: dispatchGroup) {
func makeRequest() {
let url = "http://localhost:\(httpBin.port)"
var maybeRequest: HTTPClient.Request?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ extension HTTPRequestStateMachine.Action {
fileprivate func assertFailRequest<Error>(
_ expectedError: Error,
_ expectedFinalStreamAction: HTTPRequestStateMachine.Action.FinalFailedRequestAction,
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) where Error: Swift.Error & Equatable {
guard case .failRequest(let actualError, let actualFinalStreamAction) = self else {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/SOCKSTestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MockSOCKSServer {
self.channel.localAddress!.port!
}

init(expectedURL: String, expectedResponse: String, misbehave: Bool = false, file: String = #file, line: UInt = #line) throws {
init(expectedURL: String, expectedResponse: String, misbehave: Bool = false, file: String = #filePath, line: UInt = #line) throws {
let elg = MultiThreadedEventLoopGroup(numberOfThreads: 1)
let bootstrap: ServerBootstrap
if misbehave {
Expand Down
4 changes: 2 additions & 2 deletions Tests/AsyncHTTPClientTests/XCTest+AsyncAwait.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extension XCTestCase {
internal func XCTAssertThrowsError<T>(
_ expression: @autoclosure () async throws -> T,
verify: (Error) -> Void = { _ in },
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) async {
do {
Expand All @@ -79,7 +79,7 @@ internal func XCTAssertThrowsError<T>(
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
internal func XCTAssertNoThrowWithResult<Result>(
_ expression: @autoclosure () async throws -> Result,
file: StaticString = #file,
file: StaticString = #filePath,
line: UInt = #line
) async -> Result? {
do {
Expand Down