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

Inconsistency in tests and examples #72

Closed
starius opened this issue Jan 20, 2016 · 6 comments
Closed

Inconsistency in tests and examples #72

starius opened this issue Jan 20, 2016 · 6 comments

Comments

@starius
Copy link
Contributor

starius commented Jan 20, 2016

https://github.com/avoidwork/filesize.js/blob/f7a059f/test/filesize_test.js#L22

this.kilobit = 500;
// ...
test.equal(filesize(this.kilobit, {bits :true}), "3.91 Kb", "Should be '3.91 Kb'");

https://github.com/avoidwork/filesize.js/blob/f7a059f/README.md

filesize(500, {bits: true});          // "4 kb"

Discrepancies:

  • k / K
  • 4 / 3.91

See also #69

@avoidwork
Copy link
Owner

You're welcome to change it with a PR.

@avoidwork
Copy link
Owner

The website is also 2-3yr out of date, please include updates there too.

@starius
Copy link
Contributor Author

starius commented Jan 21, 2016

Ok, I'll change values in examples to what is actually returned.

starius added a commit to starius/filesize.js that referenced this issue Jan 21, 2016
@starius
Copy link
Contributor Author

starius commented Jan 21, 2016

The website is also 2-3yr out of date, please include updates there too.

The example on the site is loaded with gist https://gist.github.com/4698968.js
I can't make a pull request to gist.

starius added a commit to starius/lua-filesize that referenced this issue Jan 21, 2016
tests from main page of http://filesizejs.com/

Some are not correct, see avoidwork/filesize.js#72
starius added a commit to starius/lua-filesize that referenced this issue Jan 21, 2016
@starius
Copy link
Contributor Author

starius commented Jan 21, 2016

I'm trying to reimplement it in Lua: https://github.com/starius/lua-filesize
I've used the example as the first test.

@avoidwork
Copy link
Owner

Ah, well I guess that's unfortunate timing; all of the tests were corrected for JEDEC/SI, because it used to be SI centric.

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