Skip to content

XCTAssertEqualWithAccuracy behavor does not match true XCTest.framework #7

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 1 commit into from
Dec 5, 2015
Merged

Conversation

mattrajca
Copy link
Contributor

The accuracy threshold check only works with unsigned numbers, however the distanceTo method we get from Strideable works in terms of offsets which can be negative. We need to take the absolute value of the distance.

This issue is causing tests for swiftlang/swift-corelibs-foundation#37 to fail.

The accuracy threshold check only works with unsigned numbers, however the distanceTo method we get from Strideable works in terms of offsets which can be negative. We need to take the absolute value of the distance.

This issue was causing tests for swiftlang/swift-corelibs-foundation#37 to fail.
parkera added a commit that referenced this pull request Dec 5, 2015
XCTAssertEqualWithAccuracy behavor does not match true XCTest.framework
@parkera parkera merged commit bb43504 into swiftlang:master Dec 5, 2015
@parkera
Copy link
Contributor

parkera commented Dec 5, 2015

Thanks!

@mattrajca
Copy link
Contributor Author

@parkera: As an aside, I find it really weird that distanceTo can return a negative number. This tripped me up in some of my work in artificial intelligence as well. I would expect a distance function to always return a non-negative value. Perhaps it should be renamed to something like offsetTo: rdar://problem/20667836

@parkera
Copy link
Contributor

parkera commented Dec 5, 2015

@mattrajca This is great feedback for the discussion on Swift 3 naming conventions. Part of that effort is to audit the Swift standard library for names like this. I think swift-dev or swift-evolution would be a great place to discuss it.

modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Jan 8, 2016
swiftlang#7 fix a
problem with XCTAssertEqualsWithAccuracy. This test ensures
that fix does not regress.
modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Jan 8, 2016
swiftlang#7 fixed a
problem with XCTAssertEqualsWithAccuracy. This test ensures
that fix does not regress.
modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Jan 11, 2016
swiftlang#7 fixed a
problem with XCTAssertEqualsWithAccuracy. This test ensures
that fix does not regress.
modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request Jan 13, 2016
swiftlang#7 fixed a
problem with XCTAssertEqualsWithAccuracy. This test ensures
that fix does not regress.
mike-ferris pushed a commit that referenced this pull request Jan 13, 2016
…withaccuracy

[Tests] Add regression tests for pull request #7
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.

2 participants