Leave paths holding % out of the uninstall command line, which cmd.exe would expand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 05:57:21 -05:00
parent 938676d57f
commit 41eacb97e8
2 changed files with 13 additions and 3 deletions

View File

@@ -340,6 +340,11 @@ class UninstallTest(Tmp):
subprocess.run(f'cmd.exe /c "{script.replace("ping -n 3 127.0.0.1 >nul", "echo")}"', capture_output=True)
self.assertFalse(root.exists())
def test_script_leaves_out_percent_paths(self):
script = winsys.uninstall_script([Path('C:/%HOMEPATH%'), Path('C:/x/a')], [Path('C:/%TEMP%/b')])
self.assertNotIn('%', script)
self.assertIn('a', script)
# ---------------------------------------------------------------- toolchain