@@ -115,6 +115,44 @@ Describe 'Show-DockerFastLoopDiagnostics.ps1' -Tag 'Unit' {
115115 $outputText | Should -Match ' capture=history-scenarios\\sequential\\block-diagram\\ni-windows-container-capture.json'
116116 }
117117
118+ It ' trims space-padded history metadata before rendering differentiated diagnostics' {
119+ $resultsRoot = Join-Path $TestDrive ' trimmed-metadata'
120+ New-Item - ItemType Directory - Path $resultsRoot - Force | Out-Null
121+ $historyRoot = Join-Path $resultsRoot ' history-scenarios'
122+ New-Item - ItemType Directory - Path (Join-Path $historyRoot ' attribute\container-export' ) - Force | Out-Null
123+ $readinessPath = Join-Path $resultsRoot ' docker-runtime-fastloop-readiness.json'
124+ ([ordered ]@ {
125+ schema = ' vi-history/docker-fast-loop-readiness@v1'
126+ historyScenarioSet = ' smoke '
127+ source = [ordered ]@ {
128+ resultsRoot = $resultsRoot
129+ }
130+ steps = @ (
131+ [ordered ]@ {
132+ name = ' windows-history-attribute '
133+ historyLane = ' windows '
134+ historyMode = ' attribute '
135+ historySequence = ' direct '
136+ isDiff = $true
137+ diffImageCount = 3
138+ durationMs = 1500
139+ diffEvidenceSource = ' html '
140+ containerExportStatus = ' success '
141+ extractedReportPath = " $ ( Join-Path $historyRoot ' attribute\container-export\windows-compare-report.html' ) "
142+ capturePath = " $ ( Join-Path $historyRoot ' attribute\ni-windows-container-capture.json' ) "
143+ }
144+ )
145+ } | ConvertTo-Json - Depth 8 ) | Set-Content - LiteralPath $readinessPath - Encoding utf8
146+
147+ $output = & pwsh - NoLogo - NoProfile - File $script :ShowScript - ReadinessPath $readinessPath * > & 1
148+ $LASTEXITCODE | Should - Be 0 - Because ($output -join " `n " )
149+
150+ $outputText = $output -join " `n "
151+ $outputText | Should -Match ' \[windows-docker-fast-loop\]\[diagnostics\] scenarioSet=smoke differentiatedSteps=1 evidenceSteps=0 reports=0'
152+ $outputText | Should -Match ' lane=windows sequence=direct mode=attribute images=3'
153+ $outputText | Should -Match ' report=history-scenarios\\attribute\\container-export\\windows-compare-report.html'
154+ }
155+
118156 It ' prints an explicit no-diagnostics message when no history diff steps exist' {
119157 $resultsRoot = Join-Path $TestDrive ' no-diff'
120158 New-Item - ItemType Directory - Path $resultsRoot - Force | Out-Null
0 commit comments