mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 15:54:18 +01:00
29 assertions across two files, run via lib/tests/run_all.sh. Coverage measured, not waived: leechblock_fetch.sh 38.57% (27/70), leechblock_browsers.sh 36.47% (31/85), config and firefox 0%. The uncovered lines are exactly the bodies that must never run under test — curl/tar/unzip downloads, pkill + sudo binary patching, npm install, and writes to /etc/*/policies.json. Closing the gap needs those externals shimmed. What the tests actually pin down: - all three get_latest_tag fallbacks (releases API, tags API, Location header), plus JSON-null-is-not-a-tag and the all-sources-exhausted non-zero return. A silent failure there installs the wrong version. - the 8+3 browser tables including every hyphenated key, and the command -v gating that decides whether a binary is patched at all. Also fixes a latent set -u abort: wire_up_browsers interpolates VERSION_DIR, VERSION and TAG, which only resolve_version sets. Calling it on its own aborted on an unbound VERSION_DIR; they are now read through locals with defaults, leaving production output unchanged. Harness note: PATH must be narrowed to the shim dir for "no browser installed" to be testable on a machine that has five, but every external the code under test calls has to be seeded there too — a missing mkdir aborted the suite under set -e with no stderr, which under kcov looked like a coverage-tool bug rather than a PATH bug. The hyphenated array subscripts in the test are quoted for the same reason they are in the lib: shfmt -w rewrites an unquoted [google-chrome-stable] into a subtraction expression. Reproduced live in this file during the work. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F3PzGc75gBcdxP3PkHXGcV |
||
|---|---|---|
| .. | ||
| contracts | ||
| evidence | ||
| memory | ||
| plans | ||
| sessions | ||
| specs | ||
| workflows | ||