Skip to content

Convert Data/DataIO Tests to swift-testing #1363

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jmschonfeld
Copy link
Contributor

Continued cherry-picks (with edits) of the initial swift-testing adoption for all of our data-related tests

@jmschonfeld jmschonfeld force-pushed the swift-testing/data-tests branch 2 times, most recently from b0c0bca to d121864 Compare June 17, 2025 21:56
@jmschonfeld jmschonfeld requested a review from jrflat June 17, 2025 21:56
@@ -893,6 +901,47 @@ private struct StringTests {
#expect(result == expected)
}
}

@Test func deletingLastPathComponent() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for consolidating these!

isEmpty = span.isEmpty
#expect(!isEmpty)
count = span.count
#expect(count == count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a different variable name (or source.count) would be good :)

Copy link
Contributor Author

@jmschonfeld jmschonfeld Jun 18, 2025

Choose a reason for hiding this comment

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

Oh good call, thanks this is probably a typo on my part 🙂 - likely a find and replace error while extracting the span calls out of the expectations (which sadly don't work because #expect can't capture the non escapable type in its escaping closure)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out that span.count in an expectation is fine, so I removed the extra variables. span.isEmpty doesn't work, so I've left the isEmpty variables and filed swiftlang/swift-testing#1164 about the discrepancy

@jmschonfeld jmschonfeld force-pushed the swift-testing/data-tests branch from d121864 to 2dede55 Compare June 18, 2025 16:14
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

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.

2 participants