Skip to content

Commit

Permalink
one more trailingRange test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Mar 14, 2022
1 parent afa945f commit a9e65b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/TextStoryTests/TextStoringRangeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ final class TextStoringRangeTests: XCTestCase {

XCTAssertEqual(storage.leadingWhitespaceRange(in: NSMakeRange(11, 9)), NSMakeRange(11, 4))
}

func testTrailingAlphas() {
let string = " some stuff"
let storage = NSTextStorage(string: string)
let range = storage.trailingRange(in: NSRange(0..<8), within: CharacterSet.alphanumerics)

XCTAssertEqual(range, NSRange(6..<8))
}
}

0 comments on commit a9e65b1

Please sign in to comment.