In a unit test, I want to assert that a method that has the potential to throw an index out of range error actually throws that error.
I'm trying to use
let array = [1,2,3]
XCTAssertThrowsError(array[3])
Why doesn't this work?
How do I test this?