diff --git a/test/extract.js b/test/extract.js index 6880cae..268579d 100644 --- a/test/extract.js +++ b/test/extract.js @@ -383,4 +383,25 @@ test('unicode', function(t) { // can unpack a bsdtar unicoded tarball }); extract.end(fs.readFileSync(fixtures.UNICODE_TAR)); +}); + +test('name-is-100', function(t) { + t.plan(3); + + var extract = tar.extract(); + + extract.on('entry', function(header, stream, callback) { + t.same(header.name.length, 100); + + stream.pipe(concat(function(data) { + t.same(data.toString(), 'hello\n'); + callback(); + })); + }); + + extract.on('finish', function() { + t.ok(true); + }); + + extract.end(fs.readFileSync(fixtures.NAME_IS_100_TAR)); }); \ No newline at end of file diff --git a/test/fixtures/index.js b/test/fixtures/index.js index 4eeeb32..034259b 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -6,3 +6,4 @@ 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'); \ No newline at end of file diff --git a/test/fixtures/name-is-100.tar b/test/fixtures/name-is-100.tar new file mode 100644 index 0000000..299b2e8 Binary files /dev/null and b/test/fixtures/name-is-100.tar differ