-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Some test coverage (combinatorics and intfuncs) #9620
Conversation
@test binomial(5,3) == 10 | ||
@test binomial(2,1) == 2 | ||
@test binomial(1,2) == 0 | ||
@test binomial(-2,1) == -2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this makes sense, but I found it surprising. Add a comment to make sure someone doesn't delete it out of puzzlement later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was adding some edge cases this seems to agree with Wolfram Alpha!
Awesome! |
Have an int32 failure:
I did wonder if that might be an issue when I was writing it. Will post a fix, hopefully that's the only one. |
|
||
@test base(2, 5, 7) == "0000101" | ||
|
||
@test bits(1035) == "0000000000000000000000000000000000000000000000000000010000001011" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this be different on int32 also? Edit: yes it will.
@timholy Thanks for you comments, updated (and hopefully will pass appveyor now). Edit: it did. |
(rebased over d877d63) |
3/4 passes and one totally random-seeming failure. We must get to the bottom of these random failures, but I think adding more tests is a good step in that direction. So, merging. |
Some test coverage (combinatorics and intfuncs)
Many thanks! |
may as well also backport these, with the exception of the base64 one which I don't think applies to release-0.3 |
(cherry picked from commit ff0470c) ref PR #9620 Conflicts: test/combinatorics.jl TST intfuncs more coverage (cherry picked from commit 3d376d1) (leave out ndigits tests that rely on #8266 which was not backported) Conflicts: test/intfuncs.jl TST fix 32bit bits test, add comment to interesting binomial result (cherry picked from commit 93f6ccb)
Backporting the new tests revealed an interesting difference in behavior between 0.3 and 0.4 for |
(Just a couple of low-hanging test files, regression tests.)
cc #9493