mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Test for ReadStream typo
This commit is contained in:
1 parent
35682ac88e
commit
bd8ea2bb85
1 file changed
+14
@@ -96,3 +96,17 @@ file4.addListener('data', function(data) {
|
||||
file4.addListener('end', function(data) {
|
||||
assert.equal(contentRead, 'yz');
|
||||
});
|
||||
|
||||
try {
|
||||
fs.createReadStream(rangeFile, {start: 10, end: 2});
|
||||
assert.fail('Creating a ReadStream with incorrect range limits must throw.');
|
||||
} catch(e) {
|
||||
assert.equal(e.message, 'start must be <= end');
|
||||
}
|
||||
|
||||
try {
|
||||
fs.createReadStream(rangeFile, {start: 2});
|
||||
assert.fail('Creating a ReadStream with a only one range limits must throw.');
|
||||
} catch(e) {
|
||||
assert.equal(e.message, 'Both start and end are needed for range streaming.');
|
||||
}
|
||||
Reference in new issue
Block a user