Skip to content
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

Drop a test. #1590

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Drop a test. #1590

merged 1 commit into from
Mar 20, 2024

Conversation

thomasvl
Copy link
Collaborator

This test was leveraging a questionable behavior of Foundation. The input isn't valid UTF-8, and there was a silent substitution going on, but trunk versions of the compiler (and hence Foundation) properly fail to make a String out of the input, so the force unwrap fails. So just drop the test as no longer valid.

This test was leveraging a questionable behavior of Foundation. The input isn't
valid UTF-8, and there was a silent substitution going on, but trunk versions of
the compiler (and hence Foundation) properly fail to make a String out of the
input, so the force unwrap fails. So just drop the test as no longer valid.
@thomasvl thomasvl requested a review from allevato March 20, 2024 16:48
@allevato
Copy link
Collaborator

allevato commented Mar 20, 2024

For posterity, this change in swift-corelibs-foundation started causing this to fail (it wasn't part of the 5.10 release, I caught it from our internal builds that track main-ish). Instead of the invalid UTF-8 code units being substituted (with U+FFFD) as they were previously (and still are on Darwin, at least in macOS 14.4), the initializer returned nil instead.

I'm not sure if that's an intentional change in swift-corelibs-foundation, but the documentation for String(bytes:encoding:) says nothing about its substitution behavior, so it's best we don't rely on it.

@thomasvl thomasvl merged commit 8378dd2 into apple:main Mar 20, 2024
10 checks passed
@thomasvl thomasvl deleted the drop_test branch March 20, 2024 17:02
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.

None yet

2 participants