From 697c1d0e71b6eca050e5522ff8d36351d7f34cb2 Mon Sep 17 00:00:00 2001 From: montjeffrey Date: Wed, 4 Nov 2026 18:18:27 -0500 Subject: [PATCH] test(clv2): run the other-case WindowsApps check only on case-insensitive filesystems test -ef compares directories on disk, so a lowercase spelling of the current user's WindowsApps only names the same directory where the filesystem ignores case (Windows, default macOS). On Linux it is a different directory, so the case is skipped there. --- tests/hooks/clv2-pymanager-launcher.test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/hooks/clv2-pymanager-launcher.test.js b/tests/hooks/clv2-pymanager-launcher.test.js index 2acc2eef2..6855ea3f0 100644 --- a/tests/hooks/clv2-pymanager-launcher.test.js +++ b/tests/hooks/clv2-pymanager-launcher.test.js @@ -159,9 +159,15 @@ test('runs the Python\\bin launcher for a WindowsApps python alias when python3 assert.deepStrictEqual(run(dirs, [dirs.alias]).map(c => c[0]), ['launcher']); })); -test('matches the current user\'s WindowsApps directory case-insensitively', () => withTree(dirs => { +// Windows and macOS filesystems ignore case, so a lowercase PATH entry names +// the same WindowsApps directory there. On a case-sensitive filesystem it +// would be another directory, so the case only runs where case is ignored. +test('matches the current user\'s WindowsApps directory spelled in another case', () => withTree(dirs => { const lower = path.join(dirs.local, 'microsoft', 'windowsapps'); - fs.mkdirSync(lower, { recursive: true }); + if (!fs.existsSync(lower)) { + console.log(' (skipped: temp filesystem is case-sensitive)'); + return; + } writePython(lower, 'python3', 'alias'); writePython(dirs.launcher, 'python3.exe', 'launcher'); assert.deepStrictEqual(run(dirs, [lower]).map(c => c[0]), ['launcher']);