adding test for #11
This commit is contained in:
parent
37a497ff7e
commit
29189bf90d
3 changed files with 15 additions and 1 deletions
|
@ -405,3 +405,16 @@ test('name-is-100', function(t) {
|
||||||
|
|
||||||
extract.end(fs.readFileSync(fixtures.NAME_IS_100_TAR));
|
extract.end(fs.readFileSync(fixtures.NAME_IS_100_TAR));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('invalid-file', function(t) {
|
||||||
|
t.plan(1);
|
||||||
|
|
||||||
|
var extract = tar.extract();
|
||||||
|
|
||||||
|
extract.on('error', function(err) {
|
||||||
|
t.ok(!!err);
|
||||||
|
extract.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
|
extract.end(fs.readFileSync(fixtures.INVALID_TGZ));
|
||||||
|
});
|
1
test/fixtures/index.js
vendored
1
test/fixtures/index.js
vendored
|
@ -7,3 +7,4 @@ exports.LONG_NAME_TAR = path.join(__dirname, 'long-name.tar');
|
||||||
exports.UNICODE_BSD_TAR = path.join(__dirname, 'unicode-bsd.tar');
|
exports.UNICODE_BSD_TAR = path.join(__dirname, 'unicode-bsd.tar');
|
||||||
exports.UNICODE_TAR = path.join(__dirname, 'unicode.tar');
|
exports.UNICODE_TAR = path.join(__dirname, 'unicode.tar');
|
||||||
exports.NAME_IS_100_TAR = path.join(__dirname, 'name-is-100.tar');
|
exports.NAME_IS_100_TAR = path.join(__dirname, 'name-is-100.tar');
|
||||||
|
exports.INVALID_TGZ = path.join(__dirname, 'invalid.tgz');
|
BIN
test/fixtures/invalid.tgz
vendored
Normal file
BIN
test/fixtures/invalid.tgz
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue