Skip to content
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

Fixing abs for Rational{<:Unsigned} #29561

Merged
merged 5 commits into from
Oct 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove extra white space in test/rational.jl
  • Loading branch information
lcontento committed Oct 8, 2018
commit ffacc1887c52ea5b48f10ddd578c9ee3cbd07b69
2 changes: 1 addition & 1 deletion test/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ using Test
@test !(1//3 < NaN)
@test !(1//3 == NaN)
@test !(1//3 > NaN)

@test abs(one(Rational{UInt})) === one(Rational{UInt})
@test abs(one(Rational{Int})) === one(Rational{Int})
@test abs(-one(Rational{Int})) === one(Rational{Int})
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to add a comment to reference this PR just above the tests. The two last tests seems unrelated to the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are perfectly right. Just the first test is related to the bug. However, I did not find other tests regarding the abs method, so I thought that checking that the signed version works too would be useful. I admit I have not much experience about writing testcases, so if you think the tests should be kept to a minimum I will remove the last two.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

These seem fine to me. The main thing is to test it and I don’t mind having a slightly unrelated test added as well.

Expand Down