Skip to content

Commit c488e8f

Browse files
authored
Restrict use of a new overload of contains() to Apple platforms that have it. (#970)
We have one test that uses a newer overload of [`contains()`](https://developer.apple.com/documentation/swift/collection/contains(_:)) that doesn't exist on older Apple platforms. This PR ensures that our use of that method is constrained to platforms that have it. ### Checklist: - [ ] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [ ] If public symbols are renamed or modified, DocC references should be updated.
1 parent e76a44f commit c488e8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: Tests/TestingTests/AttachmentTests.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ struct AttachmentTests {
301301
#expect(buffer.count > 32)
302302
#expect(buffer[0] == UInt8(ascii: "P"))
303303
#expect(buffer[1] == UInt8(ascii: "K"))
304-
#expect(buffer.contains("loremipsum.txt".utf8))
304+
if #available(_regexAPI, *) {
305+
#expect(buffer.contains("loremipsum.txt".utf8))
306+
}
305307
}
306308
valueAttached()
307309
}

0 commit comments

Comments
 (0)