added 100c name test
This commit is contained in:
parent
5dab0a3b51
commit
0042359203
3 changed files with 22 additions and 0 deletions
|
@ -383,4 +383,25 @@ test('unicode', function(t) { // can unpack a bsdtar unicoded tarball
|
||||||
});
|
});
|
||||||
|
|
||||||
extract.end(fs.readFileSync(fixtures.UNICODE_TAR));
|
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));
|
||||||
});
|
});
|
1
test/fixtures/index.js
vendored
1
test/fixtures/index.js
vendored
|
@ -6,3 +6,4 @@ exports.TYPES_TAR = path.join(__dirname, 'types.tar');
|
||||||
exports.LONG_NAME_TAR = path.join(__dirname, 'long-name.tar');
|
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');
|
BIN
test/fixtures/name-is-100.tar
vendored
Normal file
BIN
test/fixtures/name-is-100.tar
vendored
Normal file
Binary file not shown.
Loading…
Reference in a new issue