Skip to content

Commit a8c52af

Browse files
committed
Switch away from XCTFail(#function), it's doesn't capture the intended thing
1 parent bf3690f commit a8c52af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/App/Core/Dependencies/EnvironmentClient.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ import Vapor
2121
struct EnvironmentClient {
2222
// See https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependenciesmacros/dependencyclient()#Restrictions
2323
// regarding the use of XCTFail here.
24-
var allowBuildTriggers: @Sendable () -> Bool = { XCTFail(#function); return true }
25-
var allowSocialPosts: @Sendable () -> Bool = { XCTFail(#function); return true }
24+
var allowBuildTriggers: @Sendable () -> Bool = { XCTFail("allowBuildTriggers"); return true }
25+
var allowSocialPosts: @Sendable () -> Bool = { XCTFail("allowSocialPosts"); return true }
2626
var awsAccessKeyId: @Sendable () -> String?
2727
var awsDocsBucket: @Sendable () -> String?
2828
var awsReadmeBucket: @Sendable () -> String?
2929
var awsSecretAccessKey: @Sendable () -> String?
3030
var builderToken: @Sendable () -> String?
31-
var buildTimeout: @Sendable () -> Int = { XCTFail(#function); return 10 }
32-
var buildTriggerAllowList: @Sendable () -> [Package.Id] = { XCTFail(#function); return [] }
33-
var buildTriggerDownscaling: @Sendable () -> Double = { XCTFail(#function); return 1 }
34-
var buildTriggerLatestSwiftVersionDownscaling: @Sendable () -> Double = { XCTFail(#function); return 1 }
31+
var buildTimeout: @Sendable () -> Int = { XCTFail("buildTimeout"); return 10 }
32+
var buildTriggerAllowList: @Sendable () -> [Package.Id] = { XCTFail("buildTriggerAllowList"); return [] }
33+
var buildTriggerDownscaling: @Sendable () -> Double = { XCTFail("buildTriggerDownscaling"); return 1 }
34+
var buildTriggerLatestSwiftVersionDownscaling: @Sendable () -> Double = { XCTFail("buildTriggerLatestSwiftVersionDownscaling"); return 1 }
3535
// We're not defaulting current to XCTFail, because its use is too pervasive and would require the vast
3636
// majority of tests to be wrapped with `withDependencies`.
3737
// We can do so at a later time once more tests are transitioned over for other dependencies. This is
@@ -40,7 +40,7 @@ struct EnvironmentClient {
4040
var current: @Sendable () -> Environment = { .development }
4141
var mastodonCredentials: @Sendable () -> Mastodon.Credentials?
4242
var mastodonPost: @Sendable (_ client: Client, _ post: String) async throws -> Void
43-
var random: @Sendable (_ range: ClosedRange<Double>) -> Double = { XCTFail(#function); return Double.random(in: $0) }
43+
var random: @Sendable (_ range: ClosedRange<Double>) -> Double = { XCTFail("random"); return Double.random(in: $0) }
4444
}
4545

4646

0 commit comments

Comments
 (0)