Skip to content

Commit

Permalink
Add test to reproduce issue kevva#93
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Nov 3, 2021
1 parent e85ce02 commit 7c31129
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/decompress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ test('extract symlink', async () => {
expect(await realpath(join(dist, 'symlink'))).toBe(join(dist, 'file.txt'));
});

test('extract hardlink', async () => {
const dist = await createTempDir();
await m(join(FIXTURES_DIR, 'hardlink.tar'), dist);

const sourceBuf = await readFile(join(dist, 'source'));
const sourceStat = await stat(join(dist, 'source'));
const linkBuf = await readFile(join(dist, 'hard_link'));
const linkStat = await stat(join(dist, 'hard_link'));

expect(sourceBuf).toEqual(linkBuf);
expect(sourceStat.ino).toBe(linkStat.ino);
});

test('extract directory', async () => {
const dist = await createTempDir();
await m(join(FIXTURES_DIR, 'directory.tar'), dist);
Expand Down
Binary file added test/fixtures/hardlink.tar
Binary file not shown.

0 comments on commit 7c31129

Please sign in to comment.