@@ -231,6 +231,29 @@ describe.skipIf(HostProcess.Platform.defaultValue() === "win32")("installAppImag
231231 assert . equal ( NodeFS . readFileSync ( destination , "utf8" ) , NEW_APPIMAGE ) ;
232232 } ) ;
233233
234+ // A bind mount needs privileges. A macOS firmlink is the same kind of alias,
235+ // one directory entry under two paths that realpath keeps apart.
236+ it . skipIf ( ! NodeFS . existsSync ( "/System/Volumes/Data/private" ) ) (
237+ "keeps the destination when the cache reaches it through a mount alias" ,
238+ ( ) => {
239+ const input = fixture ( "T3-Code-1.2.2-x86_64.AppImage" ) ;
240+ const alias = NodePath . join ( "/System/Volumes/Data" , NodeFS . realpathSync ( input . applications ) ) ;
241+ const installerPath = NodePath . join ( alias , NodePath . basename ( input . installerPath ) ) ;
242+ NodeFS . renameSync ( input . installerPath , installerPath ) ;
243+ const entry = NodePath . join ( input . applications , NodePath . basename ( installerPath ) ) ;
244+ assert . notEqual ( NodeFS . realpathSync ( installerPath ) , NodeFS . realpathSync ( entry ) ) ;
245+ assert . equal ( NodeFS . statSync ( installerPath ) . ino , NodeFS . statSync ( entry ) . ino ) ;
246+ const destination = installAppImageUpdate ( {
247+ ...input ,
248+ installerPath,
249+ sha512 : sha512 ( NEW_APPIMAGE ) ,
250+ } ) ;
251+ assert . equal ( destination , entry ) ;
252+ assert . equal ( NodeFS . readFileSync ( destination , "utf8" ) , NEW_APPIMAGE ) ;
253+ assert . isFalse ( NodeFS . existsSync ( input . appImageFile ) ) ;
254+ } ,
255+ ) ;
256+
234257 it ( "rejects an empty source even when its digest matches" , ( ) => {
235258 const input = fixture ( ) ;
236259 NodeFS . writeFileSync ( input . installerPath , "" ) ;
0 commit comments