silence #file to #filePath differently (#96)
Motivation: only works if done when _calling_ a function, not when defining one :|. - https://github.com/apple/swift/pull/32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
This commit is contained in:
parent
7eeb0ca94c
commit
9f7dff10ad
|
|
@ -21,11 +21,11 @@ import Network
|
|||
|
||||
|
||||
func assertNoThrowWithValue<T>(_ body: @autoclosure () throws -> T, defaultValue: T? = nil, message: String? = nil,
|
||||
file: StaticString = (#file), line: UInt = #line) throws -> T {
|
||||
file: StaticString = #file, line: UInt = #line) throws -> T {
|
||||
do {
|
||||
return try body()
|
||||
} catch {
|
||||
XCTFail("\(message.map { $0 + ": " } ?? "")unexpected error \(error) thrown", file: file, line: line)
|
||||
XCTFail("\(message.map { $0 + ": " } ?? "")unexpected error \(error) thrown", file: (file), line: line)
|
||||
if let defaultValue = defaultValue {
|
||||
return defaultValue
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue