Add failing hash tests.
Add failing (on Node 0.10) tests for file size.
thanks for those tests @btrask
However they seem to break the build.
The build runs the tests and the tests fail. No surprises there. Making the tests pass is the hard part.
Oh I see, you've added them so there can be code written against them?
Would you mind adding code that supports those tests?
I was hoping someone more familiar with the project would run with it. I've already worked around the issues in my own project by overriding onPart, which is more useful for my purposes anyway.
@btrask, thanks for test cases. Hashing should be fixed here: #211, I'll take a look into file size problem next.
Should be working now in node.js v0.10.4.
This is working in Node >=0.10.4; in other versions the file._writeStream.write() call is not firing its callback, therefore not running this code: https://github.com/felixge/node-formidable/blob/afa2eb4a3e2922f0e84977b8d342f3601528ce77/lib/file.js#L55-L60
Funnily enough, Node v0.8 this code actually works; which makes me think this is actually an upstream Node bug.
Can anyone verify this for me?
@tim-smart Node 0.10.4 fixes a regression which was causing this issue - see #209 for details.
Track the state of file write callbacks.
To make sure all the write callbacks are called before the write stream has
ended. Fixes #210
Signed-off-by: Tim Smart <email@example.com>
Fixed this for v0.9 and earlier versions of v0.10. Just need to fix a regression in v0.8
OK tests are passing on node >=0.8 now.
If someone wants to review ( @felixge @net147 ):
@tim-smart thanks for working on this! The patch looks a bit complicated to me, and I think this could simplify it: tim-smart@1e0516e#commitcomment-3144964
See the updated issue (#236) for the latest :)