diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eae4fe7..608503a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,6 @@ on: branches: - '**' -env: - DEVELOPER_DIR: /Applications/Xcode_13.2.app/Contents/Developer - jobs: test: name: Test diff --git a/RearrangeTests/NSTextRangeTests.swift b/RearrangeTests/NSTextRangeTests.swift index bf6eb29..1e6da93 100644 --- a/RearrangeTests/NSTextRangeTests.swift +++ b/RearrangeTests/NSTextRangeTests.swift @@ -7,20 +7,23 @@ import UIKit #if os(macOS) || os(iOS) || os(tvOS) -@available(iOS 15.0, macOS 12.0, tvOS 15.0, *) class NSTextRangeTests: XCTestCase { - func testFullDocumentRange() { - let content = NSTextContentStorage() + func testFullDocumentRange() throws { + if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) { + let content = NSTextContentStorage() - content.attributedString = NSAttributedString(string: "abcdef") + content.attributedString = NSAttributedString(string: "abcdef") - let range = NSRange(content.documentRange, provider: content) + let range = NSRange(content.documentRange, provider: content) - XCTAssertEqual(range, NSRange(0..<6)) + XCTAssertEqual(range, NSRange(0..<6)) - let textRange = NSTextRange(NSRange(0..<6), provider: content) + let textRange = NSTextRange(NSRange(0..<6), provider: content) - XCTAssertEqual(textRange, content.documentRange) + XCTAssertEqual(textRange, content.documentRange) + } else { + throw XCTSkip() + } } }