adding test for #11
This commit is contained in:
parent
37a497ff7e
commit
29189bf90d
3 changed files with 15 additions and 1 deletions
|
@ -404,4 +404,17 @@ test('name-is-100', function(t) {
|
|||
});
|
||||
|
||||
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));
|
||||
});
|
3
test/fixtures/index.js
vendored
3
test/fixtures/index.js
vendored
|
@ -6,4 +6,5 @@ exports.TYPES_TAR = path.join(__dirname, 'types.tar');
|
|||
exports.LONG_NAME_TAR = path.join(__dirname, 'long-name.tar');
|
||||
exports.UNICODE_BSD_TAR = path.join(__dirname, 'unicode-bsd.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