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

uncovered code #75

Closed
starius opened this issue Jan 21, 2016 · 5 comments
Closed

uncovered code #75

starius opened this issue Jan 21, 2016 · 5 comments

Comments

@starius
Copy link
Contributor

starius commented Jan 21, 2016

The following case is not tested:

if (e > 8) {
    e = 8;
}
@avoidwork
Copy link
Owner

Don't care.

@starius
Copy link
Contributor Author

starius commented Jan 22, 2016

It is not clear. What is the expected result of filesize(10e40)? Currently I get "82718061255302770 YB", but maybe "8.27e+16 YB" or even "1e+41 B" is better?

@avoidwork
Copy link
Owner

Why is that better? This module is approaching 4 million downloads on npm, and you're the first person to raise this concern. Could you explain it in further detail.

@avoidwork
Copy link
Owner

IMO, scientific notation doesn't equate to 'human readable', which why it's never output that. It could of course become a customizable output, and if you would like to see that I'd be willing to take your PR to introduce it.

@starius
Copy link
Contributor Author

starius commented Jan 22, 2016

This module is approaching 4 million downloads on npm, and you're the first person to raise this concern.

There is a first time for everything :)

I noticed this while measuring coverage of my Lua version of this function. That line was the only uncovered line in the code. In Lua it becomes scientific notation and in JavaScript it is a plain integer representation.

IMO, scientific notation doesn't equate to 'human readable'

+1 for this. So "82718061255302770 YB" should be the expected output. I am going to open a pull request adding such test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants