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

Split some tests out of numbers #26060

Merged
merged 1 commit into from
Feb 15, 2018
Merged

Split some tests out of numbers #26060

merged 1 commit into from
Feb 15, 2018

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Feb 15, 2018

Moved a bunch of Rational specific tests out into their own new file, split some rounding tests out into that file. numbers.jl is really long and it might be nice to unspool it a bit?

@kshyatt kshyatt added the test This change adds or pertains to unit tests label Feb 15, 2018
@bramtayl
Copy link
Contributor

In numbers.jl tests like this:

    @test bin(typemin(Int16)) == "-1"*"0"^15
    @test bin(typemax(Int16)) == "1"^15
    @test oct(typemin(Int16)) == "-100000"
    @test oct(typemax(Int16)) == "77777"
    @test dec(typemin(Int16)) == "-32768"
    @test dec(typemax(Int16)) == "32767"
    @test hex(typemin(Int16)) == "-8000"
    @test hex(typemax(Int16)) == "7fff"
    @test string(typemin(Int16)) == "-32768"
    @test string(typemax(Int16)) == "32767"
    @test base(3,typemin(Int16)) == "-1122221122"
    @test base(3,typemax(Int16)) == "1122221121"
    @test base(12,typemin(Int16)) == "-16b68"
    @test base(12,typemax(Int16)) == "16b67"

Are repeated a lot, and could probably be factored out with a representation_profile function which would return a vector of these type mins and maxes. Something I noticed when working on the oct etc. deprecations (a total pain)

@JeffBezanson JeffBezanson merged commit 38a2c9c into master Feb 15, 2018
@JeffBezanson JeffBezanson deleted the ksh/testrat branch February 15, 2018 23:36
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

3 participants