Skip to content

Add tests for AttributedString Index Tracking preconditions #1326

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

Conversation

jmschonfeld
Copy link
Contributor

In the new AttributedString transform(updating:) functions, there are a variety of preconditions that validate the provided input. With XCTest we previously did not have a way to test these preconditions, but now swift-testing has support for exist tests in Swift 6.2. This change migrates the existing AttributedStringIndexTrackingTests suite from XCTest to swift-testing and adds two additional tests to fully cover the preconditions and expected crashes for this API.

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

Looks like we can't currently land the new tests on Windows because the latest toolchain is a few months old and doesn't have exit test support

@glessard
Copy link
Contributor

glessard commented Jun 4, 2025

@swift-ci please test

@jmschonfeld jmschonfeld force-pushed the index-tracking-precondition-tests branch from 2369930 to 5967832 Compare June 4, 2025 19:40
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit 226ba0a into swiftlang:main Jun 5, 2025
15 checks passed
@jmschonfeld jmschonfeld deleted the index-tracking-precondition-tests branch June 5, 2025 00:24
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.

3 participants