From 0042359203df4983ad7171f54aeaa202b45b126b Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Mon, 13 Jan 2014 21:17:23 +0100 Subject: [PATCH] added 100c name test --- test/extract.js | 21 +++++++++++++++++++++ test/fixtures/index.js | 1 + test/fixtures/name-is-100.tar | Bin 0 -> 10240 bytes 3 files changed, 22 insertions(+) create mode 100644 test/fixtures/name-is-100.tar 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 0000000000000000000000000000000000000000..299b2e8c352c8b4c8cdc4f544de1dbc9cf77f024 GIT binary patch literal 10240 zcmeIu!H&Wp5XSMI_bGS*7gUOmW4i4ax}lI18r`=SP0a4WG@dpd{#=GIlkm+ira_KV z8kQhgPpS9a<~#c_79Ia~p1t)c<`iV}HK%iyc|85-BDv^Xx-#~9jDuW0eVKwW##yVH zS`V(h*Lr=_dNodMcRSY_Yqxu+%-*)vHOe&qaF!Z(uF