mirror of
https://github.com/xroche/httrack.git
synced 2026-07-28 11:32:48 +03:00
* Match captured output with a here-string, not a pipe into grep -q grep -q exits on the first match, so whatever the producer still had to write takes SIGPIPE; under pipefail that becomes the pipeline's status and an assertion that held reports failure. bash issues one write() per line, so any match that is not on the last line is exposed. Converts every test assertion whose producer is a shell builtin or shell function, including two pipelines used as an if condition where the SIGPIPE silently flips the branch. Generalizes the AGENTS.md bullet, which only covered the "&& fail" spelling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> * Convert the remaining pipe-into-grep -q sites The self-test drivers survive only because the matched line is the last thing httrack prints; one added line of output turns a pass into 141. Nothing in tests/ pipes into grep -q now. The two zlib drivers claimed the harness might run them under a POSIX /bin/sh: it does not. configure resolves $(BASH) to bash, test-timeout.sh execs it, and 01_zlib-warc-wacz.test already uses "set -o pipefail" (which dash lacks) on the macOS leg. Kept the half that is true, BSD tool flags. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> --------- Signed-off-by: Xavier Roche <roche@httrack.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
10 lines
280 B
Bash
10 lines
280 B
Bash
#!/bin/bash
|
|
#
|
|
|
|
set -euo pipefail
|
|
|
|
# -%u url-hack split (#271): www / // / query-order dedup toggle independently.
|
|
# All assertions live in the engine self-test (hash compare flag resolution).
|
|
out=$(httrack -O /dev/null -#test=urlhack run)
|
|
grep -q "urlhack self-test OK" <<<"$out"
|