From d898f624bd3b03c99c1e889c1fb7e8fd68f033cf Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 4 Jul 2026 09:29:44 +0200 Subject: feat: -l shows side-by-side hint vs .info With package names, --list skips the table and shows each named hint diffed against its .info (git diff --no-index, else diff -y), missing hint exits 2. Diff display extracted to _show_hint_diff, shared with --review. Bash completion completes hint names after -l. Adds T58, T59. Co-Authored-By: Claude Opus 4.8 --- tests/mkhint_test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests') diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh index 425eba2..974441c 100755 --- a/tests/mkhint_test.sh +++ b/tests/mkhint_test.sh @@ -1122,6 +1122,31 @@ echo "$out" | grep -q "Total: 1 file" \ && { echo " PASS: count excludes versionless"; (( PASS++ )); } \ || { echo " FAIL: count wrong"; (( FAIL++ )); ERRORS+=("T57 count"); } +# ── T58: -l shows side-by-side diff, not the table ───────────────────── +echo "" +echo "T58: -l shows hint vs .info diff" +rm -f "$MOCK_HINT"/*.hint "$MOCK_HINT"/*.bak 2>/dev/null +cat > "$MOCK_HINT/curl.hint" << 'EOF' +VERSION="8.5.0" +ARCH="x86_64" +EOF +out=$(run_mkhint -l curl 2>&1) +echo "$out" | grep -q "=== curl ===" \ + && { echo " PASS: diff header shown"; (( PASS++ )); } \ + || { echo " FAIL: diff header missing"; (( FAIL++ )); ERRORS+=("T58 header"); } +echo "$out" | grep -q "HintVer" \ + && { echo " FAIL: table printed"; (( FAIL++ )); ERRORS+=("T58 table"); } \ + || { echo " PASS: no table"; (( PASS++ )); } + +# ── T59: -l → exit 2 ─────────────────────────────────────────────── +echo "" +echo "T59: -l on nonexistent hint → exit 2" +set +e +run_mkhint -l nope 2>/dev/null +code=$? +set -e +assert_exit_code "missing hint" 2 "$code" + # ─── SUMMARY ────────────────────────────────────────────────────────────────── teardown -- cgit v1.2.3