testing

Selectivity Tests Input Preservation and Uncertain Predicates

The central promise of a reducer is easy to state and surprisingly easy to weaken: the saved input should be smaller, while still satisfying the behavior being investigated. Testing only a successful reduction would miss several ways that promise can go wrong. Selectivity’s verification therefore checks the copies and the evidence around the search, alongside the search itself.

The automated tests cover line reduction, directory file removal and the optional line pass inside directory files. They also check empty input, raw line-ending preservation and files without a final newline. One predicate deliberately overwrites its disposable input. The saved result must still contain the accepted snapshot bytes, and the source must retain its original contents. A permissions test uses a restrictive creation mask to confirm that the copy restores the modeled file permissions explicitly.

Selectivity verification covers fresh input copies, uncertain outcomes and native smoke tests on three operating systems

Failure tests exercise predicates that time out, return unresolved status or alternate between outcomes. Those conditions must not justify a deletion. Budget exhaustion must leave an incomplete result, and cancellation during an execution must record the observation and count the started process. An independent review caught gaps in interrupted-attempt accounting and permission fidelity; both were corrected, with regression checks added. Empty-directory paths were also added to the modeled input digest.

There are two command line demonstrations. One generates 20000 lines containing two required trigger lines and checks that the result contains exactly those two lines. The other begins with three files and checks that the unused file disappears while the required lines remain in two nested files. These are generated examples with known answers, useful for checking the mechanics. They do not show how quickly an arbitrary real-world parser bug will reduce.

The result recorder runs go vet, the race-enabled tests and both demonstrations, saving their output in the repository’s results directory. CI runs on Linux and macOS. Release archives are built for five operating-system and processor combinations, with native executable smoke checks on Linux amd64, macOS arm64 and Windows amd64. The two other archives are cross-built. Published archives are checked against SHA256SUMS at both the versioned release and the latest-release links.

The first publication exposed an error in the verification command itself: downloading the latest release through the GitHub command line tool needs an explicit asset pattern. The archives had published successfully and were independently checked. The follow-up patch corrects that automation. It is a modest distinction, but worth recording accurately: a delivery check failed, and the fix belongs in delivery verification.