From 17cbb404ccaf36dd48fc68739b54227a7db0df01 Mon Sep 17 00:00:00 2001 From: Andreas Franek Date: Mon, 12 Aug 2024 10:27:41 +0200 Subject: [PATCH] Add test failing to stat symlinked file This demonstrates issue #248 --- test/api-spec.js | 4 ++++ test/input/stat-symlink.asar | Bin 0 -> 367 bytes 2 files changed, 4 insertions(+) create mode 100644 test/input/stat-symlink.asar diff --git a/test/api-spec.js b/test/api-spec.js index 2239d1a..2cd574c 100644 --- a/test/api-spec.js +++ b/test/api-spec.js @@ -107,4 +107,8 @@ describe('api', function () { asar.extractAll('test/expected/packthis-object-prototype.asar', 'tmp/packthis-object-prototype/') return compDirs('test/input/packthis-object-prototype/', 'tmp/packthis-object-prototype') }) + it('should stat a symlinked file', async () => { + const stats = asar.statFile('test/input/stat-symlink.asar', 'real.txt', true) + return assert.strictEqual(stats.size, 19) + }) }) diff --git a/test/input/stat-symlink.asar b/test/input/stat-symlink.asar new file mode 100644 index 0000000000000000000000000000000000000000..2269106ff5d90418103577af042304af38d3de24 GIT binary patch literal 367 zcmbu5QES5>6onn^X}==)99lId(Z0#(SRsS4=3y}Qphg?1OCZT$TiJi#O$nv%6Rvo^ zd(@-12%-80p=YQH>V$oWZp51tR`YaGgVS*}eN8hQ!;ixoDpTBhKRRHT;1q{$a)%*I z-?K-@Ll5ir1Dg9s#qt6itsYy@(s@=8Nx02~CbZ0GRvMi*(#gC5DUE2Xwv6P0m!1*k z3+p|nLQ5fyad47}y*=*FIXIO(BYa^H{q6r3y#K;T@%`s8xbFPs7`h`wR~Yd1Uo3oa Zt}iXvzf06p^0HM`Qoq*8!>-!i{Q+7_X~X~k literal 0 HcmV?d00001