adding test for #11

This commit is contained in:
Mathias Buus 2014-03-24 15:25:36 +01:00
parent 37a497ff7e
commit 29189bf90d
3 changed files with 15 additions and 1 deletions

View file

@ -405,3 +405,16 @@ 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));
});

View file

@ -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_TAR = path.join(__dirname, 'unicode.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

Binary file not shown.