From 7e8b723310d11ffedf7eaa107320298a3791c2fa Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Fri, 21 Feb 2025 16:16:19 -0500 Subject: [PATCH] Restrict use of a new overload of `contains()` to Apple platforms that have it. 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. --- Tests/TestingTests/AttachmentTests.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/TestingTests/AttachmentTests.swift b/Tests/TestingTests/AttachmentTests.swift index 3fa979b35..0a220552a 100644 --- a/Tests/TestingTests/AttachmentTests.swift +++ b/Tests/TestingTests/AttachmentTests.swift @@ -301,7 +301,9 @@ struct AttachmentTests { #expect(buffer.count > 32) #expect(buffer[0] == UInt8(ascii: "P")) #expect(buffer[1] == UInt8(ascii: "K")) - #expect(buffer.contains("loremipsum.txt".utf8)) + if #available(_regexAPI, *) { + #expect(buffer.contains("loremipsum.txt".utf8)) + } } valueAttached() }