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

Add some tests in printf.jl for BigFloat #12884

Merged
merged 1 commit into from
Sep 1, 2015

Conversation

ScottPJones
Copy link
Contributor

Added BigFloat tests, make the code a bit more general.

@test( @sprintf( "%#10.5g", 123.4 ) == " 123.40")
@test( @sprintf( "%-10.5g", 123.4 ) == "123.4 ")
@test( @sprintf( "%-+10.5g", 123.4 ) == "+123.4 ")
for (val, res) in ((12345678., "1.23457e+07"), (1234567.8, "1.23457e+06"), (123456.78, "123457"), (12345.678, "12345.7"), (12340000.0, "1.234e+07"))
Copy link
Member

Choose a reason for hiding this comment

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

Maybe line breaks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were zero line breaks in the original file, I can add them before the sections (where there are # comments) if you think it would make it easier to read.

Copy link
Member

Choose a reason for hiding this comment

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

All I see is that before it was easy to read now it is hard. Lining up the tuples would imho make it nicer. Similarly to

for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64),
for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thanks, that's a good suggestion. I was just striving for code coverage.

@ScottPJones
Copy link
Contributor Author

@KristofferC Hopefully you like this even better than the original file. Thanks for the suggestion! Anything else to make it better?

@ScottPJones
Copy link
Contributor Author

Once again, the OOM killer strikes! Nothing to do with my changes though.

@kshyatt kshyatt added the test This change adds or pertains to unit tests label Aug 31, 2015
jakebolewski added a commit that referenced this pull request Sep 1, 2015
Add some tests in printf.jl for BigFloat
@jakebolewski jakebolewski merged commit d62520f into JuliaLang:master Sep 1, 2015
@ScottPJones ScottPJones deleted the spj/printf branch September 1, 2015 17:29
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.

4 participants