"Universal Error" testing method


(Elijah Johnson) #1

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170417/035965.html

My experience with XCTest and optionals recently was that XCTest runs in a
separate process and reloads the application for subsequent tests. I
auto-converted some Java code and added force-unwrap everywhere as a first
stage. The offending optionals get fixed quite fast and I don’t think they
are meant to be part of the testing process.

I agree you might want to have a “fatal error” test case though, to be sure
your application doesn’t accept strange input. If you really need this now,
there seems to be a library for it -
https://github.com/mohamede1945/AssertionsTestingExample.