1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00

fix(windows): skip unresolved system volume optimization

Refs #604
This commit is contained in:
Tw93
2026-03-21 13:26:20 +08:00
parent 73dd3e3c43
commit 95616d45c7
2 changed files with 39 additions and 1 deletions

View File

@@ -61,6 +61,13 @@ Describe "Optimize Command" {
$result = & powershell -ExecutionPolicy Bypass -File "$script:BinDir\optimize.ps1" -ShowHelp 2>&1
$result -join "`n" | Should -Match "DryRun|Disk|DNS"
}
It "Should guard disk optimization when the system drive cannot be resolved to a volume" {
$source = Get-Content "$script:BinDir\optimize.ps1" -Raw
$source | Should -Match "function Test-SystemDriveOptimizable"
$source | Should -Match "Get-Volume -DriveLetter"
$source | Should -Match "Disk optimization skipped:"
}
}
}