windows core tests - #64
Merged
Merged
Conversation
The workspace did not build on Windows at all. Now 290 tests, 97.77% coverage and zero surviving mutants, with the format catalogue derived from seventeen real copies rather than from assumption. The sequence counter does not count copies here: it climbs 5 to 15 per copy depending on how it was made, so the watcher declares its cadence instead of defaulting to the macOS one and inventing lost copies.
…pboard A format promised with no data blocks GetClipboardData for 30 seconds exactly — measured with the owning process suspended, which is rdpclip with the session gone. What is already in the clipboard answers in 1.5 ms even then, so every read runs under a 100 ms ceiling and what does not arrive is recorded as absent rather than waited for. Capture refuses before asking for a byte, notes the whole set while copying only the whitelist, and transcodes DIB to PNG as a synthetic format while recording the original and its size. Restore writes images twice: the PNG for modern targets and a rebuilt CF_DIBV5 for Paint, which does not read PNG. This gives cp_core::dib and Catalog::declines their first production caller; declines was the only privacy rule in the catalogue with no path to execution. Paste adds Failure::TargetElevated, which Windows needs and macOS does not: UIPI drops injected input at a higher integrity level and SendInput still reports the full count. The probe stopped being observational now that Windows can write. One of its cases caught the battery leaving a secrecy marker behind, which made the next run fail — it now cleans up, and a case checks that it did. Mutants run over the crates without a system call, as macOS already did: cp-win-sys is verified by the probe, not by mutation. 376 tests, 25 system cases, cp-win-sys behind the same unsafe rule as cp-mac-sys.
rgdevment
force-pushed
the
rgdevment/windows-audit-core-tests
branch
from
September 14, 2026 19:47
031c85e to
c781a57
Compare
Paste is verified end to end: the probe creates its own target window, brings it forward, sends the nine-event batch and reads what arrived in the control. The other half is verified too — against a dead target it degrades to TargetGone and the text stays in the clipboard, so the worst outcome is still "paste it yourself". Polling the sequence number costs 267 ns, so the watcher polls instead of registering a message-only window: AddClipboardFormatListener would have bought nothing measurable. OCR reads the shared fixture in 35 ms against Vision's 180 on macOS. The decision does not change — it still runs after capture, never during. windows-future 0.3 dropped synchronous waiting, so completion is awaited by polling status under a five second ceiling rather than pulling in an executor. Tests that touch the clipboard moved to the probe: it is a single global resource, so they raced each other under cargo test's parallelism. That is the same split macOS reached from the other side, where NSPasteboard demands the main thread. 388 tests, 34 system cases.
The 2.x thumbnail rule throws away wide images. It calls anything with *either* side under 64 px a generic icon, and this project's own fixture comes back from the shell at 256x57, so its thumbnail was discarded. A generic icon is small *and* square; a thumbnail keeps the source ratio, so the test is both sides, not one. It now yields 5,895 bytes against 126,497 of the original, in 32 ms. Media metadata arrives through IPropertyStore and thumbnails through IShellItemImageFactory, both behind a COM apartment and a path the shell accepts — canonicalize hands back a \\?\ prefix that it refuses. Windows now matches macOS piece for piece: catalogue, fourteen-class classification, watcher, capture, restore, paste, permissions, bounded reads, copy-vs-cut, DIB to PNG and back, OCR, media metadata and shell thumbnails. 402 tests, 37 system cases, 95.10% coverage with the harness included, zero surviving mutants. The Windows coverage gate moves from 90 to 95.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.