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

Some test coverage (combinatorics and intfuncs) #9620

Merged
merged 4 commits into from
Jan 5, 2015
Merged

Conversation

hayd
Copy link
Member

@hayd hayd commented Jan 5, 2015

(Just a couple of low-hanging test files, regression tests.)

cc #9493

@test binomial(5,3) == 10
@test binomial(2,1) == 2
@test binomial(1,2) == 0
@test binomial(-2,1) == -2
Copy link
Sponsor Member

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?

Copy link
Member Author

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!

@timholy
Copy link
Sponsor Member

timholy commented Jan 5, 2015

Awesome!

@hayd
Copy link
Member Author

hayd commented Jan 5, 2015

Have an int32 failure:

exception on 2: ERROR: test failed: ("000004db" == "00000000000004db")
626 in expression: num2hex(1243) == "00000000000004db"

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"
Copy link
Member Author

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.

@hayd
Copy link
Member Author

hayd commented Jan 5, 2015

@timholy Thanks for you comments, updated (and hopefully will pass appveyor now). Edit: it did.

@hayd
Copy link
Member Author

hayd commented Jan 5, 2015

(rebased over d877d63)

@ViralBShah ViralBShah added the test This change adds or pertains to unit tests label Jan 5, 2015
@timholy
Copy link
Sponsor Member

timholy commented Jan 5, 2015

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.

timholy added a commit that referenced this pull request Jan 5, 2015
Some test coverage (combinatorics and intfuncs)
@timholy timholy merged commit d757543 into JuliaLang:master Jan 5, 2015
@timholy
Copy link
Sponsor Member

timholy commented Jan 5, 2015

Many thanks!

@tkelman
Copy link
Contributor

tkelman commented Jan 5, 2015

may as well also backport these, with the exception of the base64 one which I don't think applies to release-0.3

@hayd hayd deleted the tests branch January 5, 2015 23:41
tkelman pushed a commit that referenced this pull request Jan 6, 2015
(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)
@tkelman
Copy link
Contributor

tkelman commented Jan 6, 2015

squashed and backported in 0582c44, and slightly tweaked to make pass on release-0.3 in 31ef3c1

@tkelman
Copy link
Contributor

tkelman commented Jan 6, 2015

Backporting the new tests revealed an interesting difference in behavior between 0.3 and 0.4 for gcd and lcm - 2508fcb. Something for @JuliaBackports to keep in mind, hopefully obscure enough that it won't affect much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants