Skip to content

Fix PIFLoadingUnitTests.loadingStandardTarget() and clean up other tests in that suite. #100

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 1 commit into from
Feb 7, 2025

Conversation

mhrawdon
Copy link
Contributor

@mhrawdon mhrawdon commented Feb 5, 2025

loadingStandardTarget() had several checks which were failing, and had been broken for a long time but had been masked by other behavior which was recently fixed.

Many other tests were written early in the project's history, and could be updated to use newer paradigms. In particular, many unnecessary optionals and force-unwraps have been removed or converted.

One of the principles applied here is that tests should strive to perform as much as their testing as is reasonable, and not simply stop on first failure. Even lines which fail an #expect() can often move on to the section block of the test rather than skipping everything afterwards.

@mhrawdon
Copy link
Contributor Author

mhrawdon commented Feb 5, 2025

@swift-ci test

…sts in that suite.

loadingStandardTarget() had several checks which were failing, and had been broken for a long time but had been masked by other behavior which was recently fixed.

Many other tests were written early in the project's history, and could be updated to use newer paradigms. In particular, many unnecessary optionals and force-unwraps have been removed or converted.

One of the principles applied here is that tests should strive to perform as much as their testing as is reasonable, and not simply stop on first failure. Even lines which fail an #expect() can often move on to the section block of the test rather than skipping everything afterwards.
@mhrawdon mhrawdon force-pushed the mhrawdon/PIFLoadingUnitTests-fixes-and-cleanup branch from 73c2954 to ad0d3bf Compare February 6, 2025 22:38
@mhrawdon
Copy link
Contributor Author

mhrawdon commented Feb 6, 2025

@swift-ci test

@mhrawdon mhrawdon merged commit 0f05cd2 into main Feb 7, 2025
1 of 2 checks passed
@mhrawdon mhrawdon deleted the mhrawdon/PIFLoadingUnitTests-fixes-and-cleanup branch February 7, 2025 01:17
do
{
let fileRef = fileGroup.children[0] as! FileReference
if let fileRef = try? #require(fileGroup.children.first as? FileReference) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this pattern introduced some warnings and also unintentionally changed behavior -- since there is no else case, a previous crash is now an unexpected pass rather than a failure. Fixing in #135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants