[swift-corelibs-dev] [swift-evolution] Proposal: XCTest Support for Swift Error Handling
Brian Gesiak
modocache at gmail.com
Wed Jan 13 19:20:57 CST 2016
Loving those commits! Especially the corresponding tests :)
Can you explain the decision to not go through the review process? I think
it's a prudent decision and I'm supportive of it, but I was under the
impression that additional APIs should be proposed and reviewed. Is the
rationale that swift-corelibs-xctest is too immature to justify going
through proposals?
- Brian Gesiak
On Wed, Jan 13, 2016 at 4:52 PM, Chris Hanson via swift-evolution <
swift-evolution at swift.org> wrote:
> Thanks, everyone, for all of the feedback.
>
> I sent this proposal out as more of a “heads up” that we were planning to
> make these changes and get feedback in advance of that, so we won’t be
> taking this through the full proposal process. That said, here’s what we’re
> going to be doing:
>
> 1. We’re going to let test methods throw, and treat those as unexpected
> failures, as planned.
>
> 2. We’re going to let test assertion expressions throw, and treat those as
> unexpected failures, as planned. We recognize that this will result in
> slightly different style in tests versus in regular code, but the
> convenience and reduction in boilerplate makes this worthwhile.
>
> 3. We’re going to add the XCTAssertThrowsError assertion, incorporating
> Kevin Ballard’s suggestion for how to avoid the “_ = blah()” in its
> expression.
>
> 4. We’re *not* going to add the ability for XCTAssertThrowsError to check
> that a specific error was thrown. This could definitely be useful but would
> require the function to take an ErrorType instance that also conforms to
> Equatable. We need to think about that some more before making such a
> change. Fortunately this sort of addition will be straightforward to put in
> via an overload or default argument, so if we choose to do it later, it
> shouldn’t break any code that starts to adopt XCTAssertThrowsError.
>
>
> We’re going to start landing these changes today, so thanks again for all
> of your attention and feedback!
>
> -- Chris
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160113/55511670/attachment.html>
More information about the swift-corelibs-dev
mailing list