test: ensure stream preprocessing order#7741
test: ensure stream preprocessing order#7741vsemozhetbyt wants to merge 11 commits intonodejs:masterfrom vsemozhetbyt:test-fixtures-stream-preprocess
Conversation
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory.
|
Sorry, this is my first test at all, and I am not sure if I have not done some stupid things. |
|
The actual test file should be in Also, I'm not sure a |
|
@mscdex So should I delete Should I also rename the |
|
I'd leave the text files in The changes look good now, although you will need to fix your paths. |
|
I've fixed them before moving, also |
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const rl = require('readline'); | ||
| /******************************************************************************/ |
There was a problem hiding this comment.
This is a minor nit, but in keeping with the style of most of the other tests, it's probably best to just replace this line with a blank line and remove the other two earlier asterisk lines completely.
|
|
||
| // get the data by a non-stream way to compare with the streamed data | ||
| const modelData = fs.readFileSync( | ||
| path.join(__dirname, '..', 'fixtures', 'file-to-read-without-bom.txt'), 'utf8' |
There was a problem hiding this comment.
path.join(common.fixturesDir, 'file-to-read-without-bom.txt') (and below where appropriate)?
|
|
||
| const BOM = '\uFEFF'; | ||
|
|
||
| // get the data by a non-stream way to compare with the streamed data |
There was a problem hiding this comment.
nit: Comments should be capitalized and punctuated; also, maybe using is better than by?
|
@addaleax Thank you. |
|
LGTM with CI: https://ci.nodejs.org/job/node-test-commit/4243/ (Edit: is green.) |
|
Landed in ea725ed, thanks! |
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory. PR-URL: #7741 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory. PR-URL: #7741 Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
This test fails on node v0.8, v0.10, v0.12 for I'm not sure if this is something @nodejs/lts wants to look into for v0.12. |
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory. PR-URL: #7741 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory. PR-URL: #7741 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case. See nodejs/help#221 as the prehistory. PR-URL: #7741 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
test
Description of change
Sometimes it is necessary to preprocess some initial bit of a stream data before giving the entire stream to the main processing function. Sometimes this bit should be extracted from the stream before the main processing; sometimes it should be returned to the stream. This test checks an order of stream modes, methods and events for a possible preprocessing algorithm. Stream BOM stripping is selected as a use case.
See nodejs/help#221 as the prehistory.