You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(ocr): finish ISystemEnvironment abstraction — read via the interface
TesseractOcrProvider.ExtractTextFromImageAsync gated on
_systemEnvironment.FileExists(txtPath) but then read the file via
the concrete File.ReadAllTextAsync. Half-applied abstraction —
trivially testable for the missing-file branch, but the success
branch couldn't be exercised without touching the real filesystem.
- ISystemEnvironment: add ReadAllTextAsync(string, CancellationToken).
- RuntimeSystemEnvironment: implement as File.ReadAllTextAsync passthrough.
- TesseractOcrProvider: read through the interface.
- FakeSystemEnvironment test helper: expose ReadAllTextImpl alongside
the existing FileExistsImpl.
- New tests:
* ExtractTextFromImageAsync_ReadsOutputViaSystemEnvironment_AndNormalisesWhitespace
verifies the provider consults the abstraction (not File) AND
that the trim/CR/LF normalisation collapses to single spaces.
* RuntimeSystemEnvironmentTests.ReadAllTextAsync_DelegatesToFileSystem
covers the new RuntimeSystemEnvironment implementation.
Coverage held at 100% (229/229 lines, 247 tests, net10.0).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments