Fox icon indicating copy to clipboard operation
Fox copied to clipboard

Show failures inline in the editor

Open loufranco opened this issue 10 years ago • 2 comments

I am using Swift -- not sure what happens in Obj-C.

If you call XCTFail instead of throwing an exception, Xcode will show the error inline in the editor at the appropriate line.

I'm willing to make a PR to implement this, but asking for guidance. It feels like I need to pass a closure to use instead of raising, potentially in FOXOptions.

Any thoughts on whether this is a desired PR and how to go about it?

loufranco avatar Jan 16 '15 00:01 loufranco

I think this is a good change to make. For mostly experimental reasons, I've avoided integrating XCTest since that is the only function required and it's harder to integrate it in other contexts beside XCTestCases in objective-c (since the objc version of XCTFail requires self to be an XCTestCase instance).

That being said, the Fox's Assert function in Swift can be expanded to include the implementation of _FOXAssert that uses XCTest instead of raising an exception.

jeffh avatar Jan 16 '15 03:01 jeffh

Ok, I'll propose something soon. I saw that problem in Obj-C. Perhaps Fox needs a configuration -- that might address #20 and also allow a failWith:(msg:String, file:String, line:Int)->() that you could pass in. In Objective-C, if you are in a XCTestCase, you can capture self.

loufranco avatar Jan 16 '15 13:01 loufranco