Skip to content

Commit cd8d0d2

Browse files
committed
Add failing test for out of bounds exception
1 parent 3ed749a commit cd8d0d2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

StackViewControllerTests/StackViewControllerTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,21 @@ class StackViewControllerTests: XCTestCase {
121121
XCTAssertEqual([1, 10], stackViewController.items.map { $0.tag })
122122
XCTAssertEqual(2, stackViewController.childViewControllers.count)
123123
}
124+
125+
func testReplaceItems() {
126+
stackViewController.items = [
127+
createViewWithTag(1),
128+
TestViewController(tag: 10)
129+
]
130+
131+
stackViewController.items = [
132+
createViewWithTag(2),
133+
TestViewController(tag: 20)
134+
]
135+
136+
XCTAssertEqual([2, 20], stackViewController.items.map { $0.tag })
137+
XCTAssertEqual(2, stackViewController.childViewControllers.count)
138+
}
124139
}
125140

126141
private extension StackViewItem {

0 commit comments

Comments
 (0)