Skip to content

Commit

Permalink
Actually skip test on older OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Feb 15, 2022
1 parent e99fc65 commit 320acef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
branches:
- '**'

env:
DEVELOPER_DIR: /Applications/Xcode_13.2.app/Contents/Developer

jobs:
test:
name: Test
Expand Down
19 changes: 11 additions & 8 deletions RearrangeTests/NSTextRangeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}

Expand Down

0 comments on commit 320acef

Please sign in to comment.