Skip to content

Commit

Permalink
Add test for IndexPath range subscript crash
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickPijnappel committed Mar 15, 2022
1 parent 8eaac64 commit b8f082a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/Foundation/Tests/TestIndexPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ class TestIndexPath: XCTestCase {
XCTAssertEqual(ip4.count, 2)
XCTAssertEqual(ip4[0], 2)
XCTAssertEqual(ip4[1], 3)

let ip5 = ip3[1...]
XCTAssertEqual(ip5.count, 2)
XCTAssertEqual(ip5[0], 3)
XCTAssertEqual(ip5[1], 4)

let ip6 = ip3[2...]
XCTAssertEqual(ip6.count, 1)
XCTAssertEqual(ip6[0], 4)
}

func testAppending() {
Expand Down

0 comments on commit b8f082a

Please sign in to comment.