[swift-corelibs-dev] Language or XCTest improvements to allow testing assert/precondition failures

David Hart david at hartbit.com
Sun Dec 13 04:03:26 CST 2015


Currently, it is impossible for XCTest to unit test assert and precondition failures because they kill the process. And those are important to unit test: how would you test NSArray's objectAtIndex bound conditions? Currently, the standard library tests those with StdlibUnittest, a small piece of code which runs those tests in a forked process.

I want to start a proposal but I'm not sure if it should come as a XCTest improvement which spawns a process or if the language should implement assert and precondition as a special kind of throw?

David


More information about the swift-corelibs-dev mailing list