"Convert to XCTest..." should eliminate empty failure messages when converting STAssert to XCTAssert
| Originator: | B.Gesiak | ||
| Number: | rdar://20066289 | Date Originated: | 05-Mar-2015 11:21 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Reproducible: |
Summary: When converting test suites with many instances of STAssert, I've noticed that a lot of developers used to write: ``` STAssert(/* ...some expression... */, @""); ``` The trailing string is an empty failure message. Many developers didn't realize you could pass `nil` in order to get an empty failure message from `STAssert`--or maybe they did no, but preferred to pass an empty string. In any case, the current "Convert to XCTest..." tool converts the above to: ``` XCTAssert(/* ...some expression... */, @""); ``` But it would be better if it got rid of the (obviously meaningless) empty string, since `XCTAssert` does not need to be given a second parameter. Therefore it should the first `STAssert` would be converted to: ``` XCTAssert(/* ...some expression... */); ``` Steps to Reproduce: 1. Create an .ocunit test bundle that uses SenTestingKit, and includes an `STAssert(true, @"")` 2. Run the "Convert to XCTest..." tool in Xcode. Expected Results: The call to `STAssert(true, @"")` would be converted to `XCTAssert(true)`. Actual Results: The call to `STAssert(true, @"")` is converted to `XCTAssert(true, @"")`. Version: Version 6.1.1 (6A2008a), OS X 10.10.2 Notes: Configuration: Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!