aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-04 09:24:02 +0200
committerDanilo M. <danix@danix.xyz>2026-07-04 09:24:02 +0200
commit11d1c51b97ae830b591c51b874da01de90a083dc (patch)
treeebd0a6a9e8e807dc9e8eb6aa3b9214295602f423 /tests
parent64f419d7485cefee854c04c5b49e8adfc5e80531 (diff)
downloadmkhintfile-11d1c51b97ae830b591c51b874da01de90a083dc.tar.gz
mkhintfile-11d1c51b97ae830b591c51b874da01de90a083dc.zip
feat: -l skips versionless hints, widen version columns
--list now skips hint files with no VERSION (e.g. pure DELREQUIRES hints) and excludes them from the total. Version columns widened 10->22 to fit long version strings without shifting other rows. Adds T57. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mkhint_test.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh
index 421d7b6..425eba2 100755
--- a/tests/mkhint_test.sh
+++ b/tests/mkhint_test.sh
@@ -1098,6 +1098,30 @@ code=$?
set -e
assert_exit_code "mutually exclusive" 1 "$code"
+# ── T57: -l skips hints with no VERSION ──────────────────────────────────────
+echo ""
+echo "T57: -l lists only hints that have a VERSION"
+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
+# no VERSION line at all
+cat > "$MOCK_HINT/novers.hint" << 'EOF'
+ARCH="x86_64"
+DELREQUIRES="rust-opt"
+EOF
+out=$(run_mkhint -l 2>&1)
+echo "$out" | grep -q "curl.hint" \
+ && { echo " PASS: versioned hint shown"; (( PASS++ )); } \
+ || { echo " FAIL: versioned hint missing"; (( FAIL++ )); ERRORS+=("T57 shown"); }
+echo "$out" | grep -q "novers.hint" \
+ && { echo " FAIL: versionless hint shown"; (( FAIL++ )); ERRORS+=("T57 skip"); } \
+ || { echo " PASS: versionless hint skipped"; (( PASS++ )); }
+echo "$out" | grep -q "Total: 1 file" \
+ && { echo " PASS: count excludes versionless"; (( PASS++ )); } \
+ || { echo " FAIL: count wrong"; (( FAIL++ )); ERRORS+=("T57 count"); }
+
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
teardown