-
Notifications
You must be signed in to change notification settings - Fork 118
Verify records Swift Testing issue with source location. #369
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
base: master
Are you sure you want to change the base?
Verify records Swift Testing issue with source location. #369
Conversation
7424de3
to
4245adf
Compare
} | ||
return | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The part above is the only thing that's needed to make the test correctly fail in Swift Testing. All the rest is just to make it show in the editor.
#endif | ||
|
||
#if canImport(XCTest) | ||
XCTAssert(expression(), message(), file: filePath, line: line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed file to filePath here because XCTAssert's default parameter is #filePath as well. Is this a correct thing to do? It still shows up at the correct place in source in the editor.
4245adf
to
5b23428
Compare
Great to see this, thanks @Stannieman! @spaluchiewicz any help on getting this in is much appreciated. |
I discovered that there is 1 thing still missing: the base64 templates in https://github.com/MakeAWishFoundation/SwiftyMocky/blob/3672eea08c7098214ac54ee26c7a7e39ea01a2f1/Sources/CLI/Core/Assets/Assets.swift still need to be updated. |
Fixed! |
PR updated to also include Swift Testing support for SwiftyMockyTestObserver. These failures still don't show up in the editor for some reason but at least we have full support now. BTW: Is there a nice way to edit the templates are it it just raw dogging without syntax highlighting/autocomplete? |
9e366d4
to
1375b4d
Compare
1375b4d
to
d2f7cdc
Compare
Verify failed silently in Swift Testing because it does not pick up
XCTAssert
failure used inMockyAssert
.This PR uses Swift Testing's Issue.record IF running inside a Swift Testing test. Additionally there is a bunch of changes to make the error show at the correct place in source in the editor.