Skip to content

Add String tests from stdlib #293

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 4 commits into from
Oct 19, 2023
Merged

Conversation

itingliu
Copy link
Contributor

@itingliu itingliu commented Oct 12, 2023

Batch add String and Substring tests from stdlib. These were removed from stdlib in https://github.com/apple/swift/pull/67252/files and swiftlang/swift#67450. These tests were added to test Foundation's StringProtocol extension that called into NSString API.

Now that some of the tests were implemented with Swift natively, they should be made available for FoundationPreview, but we'll track that in a separate PR.

…epo)

Batch add `String` and `Substring` tests for from stdlib to FCF. These were removed from stldlib in https://github.com/apple/swift/pull/67252/files and swiftlang/swift#67450. These tests were added to test Foundation's `StringProtocol` extension that called into `NSString` API.

Now that some of the tests were implemented with Swift natively, they should be made available for FoundationPreview, but we'll track that in a separate PR.
…nctions those localized functions can call into and pass in a locale explicitly for testing.
@itingliu
Copy link
Contributor Author

@swift-ci please test

}

expectEqual(ComparisonResult.orderedSame,
"abc".compare("abc", locale: Locale.current))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this an explicit locale so that the results of this test don't depend on the test host device's locale (in actually, I guess the current locale would probably never actually affect this comparison since they're equal, but might be a good change for correctness' sake?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Definitely

@itingliu
Copy link
Contributor Author

@swift-ci please test

@itingliu itingliu merged commit 31571a4 into swiftlang:main Oct 19, 2023
@itingliu itingliu deleted the stdlib-swift-test branch October 19, 2023 16:52
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