diff --git a/test/extract.js b/test/extract.js index 6c95d37..9ac9765 100644 --- a/test/extract.js +++ b/test/extract.js @@ -503,3 +503,33 @@ test('base 256 uid and gid', function (t) { extract.end(fs.readFileSync(fixtures.BASE_256_UID_GID)) }) + +test('base 256 size', function (t) { + t.plan(2) + + var extract = tar.extract() + + extract.on('entry', function (header, stream, callback) { + t.deepEqual(header, { + name: 'test.txt', + mode: parseInt('644', 8), + uid: 501, + gid: 20, + size: 12, + mtime: new Date(1387580181000), + type: 'file', + linkname: null, + uname: 'maf', + gname: 'staff', + devmajor: 0, + devminor: 0 + }) + callback() + }) + + extract.on('finish', function () { + t.ok(true) + }) + + extract.end(fs.readFileSync(fixtures.BASE_256_SIZE)) +}) diff --git a/test/fixtures/base-256-size.tar b/test/fixtures/base-256-size.tar new file mode 100644 index 0000000..f642773 Binary files /dev/null and b/test/fixtures/base-256-size.tar differ diff --git a/test/fixtures/index.js b/test/fixtures/index.js index 4e686bd..8608bde 100644 --- a/test/fixtures/index.js +++ b/test/fixtures/index.js @@ -13,3 +13,4 @@ exports.SPACE_TAR_GZ = path.join(__dirname, 'space.tar') exports.GNU_LONG_PATH = path.join(__dirname, 'gnu-long-path.tar') exports.BASE_256_UID_GID = path.join(__dirname, 'base-256-uid-gid.tar') exports.LARGE_UID_GID = path.join(__dirname, 'large-uid-gid.tar') +exports.BASE_256_SIZE = path.join(__dirname, 'base-256-size.tar')