Skip to content

[SR-1417] Add non-optional overloads of XCTAssertEqual and XCTAssertN… #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2016
Merged

[SR-1417] Add non-optional overloads of XCTAssertEqual and XCTAssertN… #123

merged 2 commits into from
Jun 10, 2016

Conversation

nsalmoria
Copy link
Contributor

…otEqual

Previously, the only version of the functions that accepted values was the one that implicitly wraps them into Optionals. This generated a confusing error message when the assert failed. Having a separate overload that accepts non-optional types ensures that the correct description is printed when the assert fails.

…otEqual

Previously, the only version of the functions that accepted values was the one that implicitly wraps them into Optionals. This generated a confusing error message when the assert failed. Having a separate overload that accepts non-optional types ensures that the correct description is printed when the assert fails.
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit-pick: Looks like you added some extra whitespace here. Can you remove it?

@nsalmoria
Copy link
Contributor Author

@modocache done!

@modocache
Copy link
Contributor

Very excited to merge this change!! Thanks, @nsalmoria!

@swift-ci please test

@modocache modocache merged commit 5bd36b5 into swiftlang:master Jun 10, 2016
@modocache
Copy link
Contributor

Thanks, @nsalmoria! 💯

@ddunbar
Copy link
Contributor

ddunbar commented Jun 10, 2016

I haven't looked closely, but is it possible that this means there is code Linux XCTest will accept that Darwin XCTest will reject?

@modocache
Copy link
Contributor

@ddunbar No, I don't think you have to worry about that here, for two reasons:

  1. This same change has been applied to the Swift overlay for Darwin XCTest: SR-1417: Add non-optional overloads of XCTAssertEqual and XCTAssertNotEqual swift#2788. So, assuming one is using versions of Swift and swift-corelibs-xctest that were both built after two days ago, they should be identical.
  2. The optional overloads simply improve the failure message for XCTAssertEqual. There's no change to how that function is invoked.

But let me know if I'm missing something here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants