This repository was archived by the owner on Aug 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Expand file tree Collapse file tree 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ if (Test-Path $cleanupListFile)
174174 $registryEntries = $entities.totalRegistryEntries
175175 Write-Host ' Dry run summary:'
176176 Write-Host ' ----------'
177- Print - Size($size )
177+ Display - Size($size )
178178 Write-Host " Total space saved (in exact bytes): $size "
179179 Write-Host " Total registry entries to delete: $registryEntries "
180180 Write-Host " ----------"
@@ -278,7 +278,7 @@ if (Test-Path $cleanupListFile)
278278 Write-Host ' ----------'
279279 }
280280
281- Print - Size($totalSize )
281+ Display - Size($totalSize )
282282 Write-Host " Total space saved (in exact bytes): $totalSize "
283283 Write-Host " Total registry entries deleted: $totalRegistryEntries "
284284 }
Original file line number Diff line number Diff line change 1- function Print -Size {
1+ function Display -Size {
22 param (
33 [Parameter (Mandatory = $true )]
44 [long ]$size
Original file line number Diff line number Diff line change 1+ Describe ' Display-Size' {
2+ BeforeAll {
3+ . $PSScriptRoot / ../ src/ math.ps1
4+ Mock Write-Host {}
5+ }
6+
7+ It ' Should display size in KB.' {
8+ Display- Size - size 1025
9+
10+ Should - Invoke Write-Host - Exactly 1
11+ Should - Invoke Write-Host - Exactly 1 - ParameterFilter { $Object -eq " Total space saved: 1 KB" }
12+ }
13+
14+ It ' Should display size in MB.' {
15+ Display- Size - size 1048577
16+
17+ Should - Invoke Write-Host - Exactly 1
18+ Should - Invoke Write-Host - Exactly 1 - ParameterFilter { $Object -eq " Total space saved: 1 MB" }
19+ }
20+
21+ It ' Should display size in GB.' {
22+ Display- Size - size 1073741825
23+
24+ Should - Invoke Write-Host - Exactly 1
25+ Should - Invoke Write-Host - Exactly 1 - ParameterFilter { $Object -eq " Total space saved: 1 GB" }
26+ }
27+
28+ It ' Should not display anything.' {
29+ Display- Size - size 1023
30+
31+ Should -Not - Invoke Write-Host
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments