aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-07 18:58:35 +0200
committerDanilo M. <danix@danix.xyz>2026-07-07 18:59:20 +0200
commit2841638a0146982322b53db7c305bdeb84456249 (patch)
tree12ddae7a539c9b75f13fb71a325b8b34220df5aa /tests
parenta6bbb96d31fb1df707ba3eea182e68b2f1c35552 (diff)
downloadmkhintfile-2841638a0146982322b53db7c305bdeb84456249.tar.gz
mkhintfile-2841638a0146982322b53db7c305bdeb84456249.zip
feat: add --force flag (check-only, mutually exclusive elsewhere)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mkhint_test.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh
index 0d1553d..62e9f2f 100755
--- a/tests/mkhint_test.sh
+++ b/tests/mkhint_test.sh
@@ -1641,6 +1641,22 @@ echo "$out" | grep -qi 'manifest' \
|| { echo " PASS: no manifest code for non-listed"; (( PASS++ )); }
rm -f "$MOCK_BASE/manifest_fixture" "$MOCK_BASE/bundle-manifests"
+# ── T-BM12: --force with --hintfile → exit 1 ─────────────────────────────────
+echo ""
+echo "T-BM12: --force is --check-only (errors with --hintfile/--new/--fix-current)"
+set +e
+o1=$(run_mkhint --force -f curl -V 1.0 2>&1); c1=$?
+o2=$(run_mkhint --force -n curl 2>&1); c2=$?
+o3=$(run_mkhint --force -F 2>&1); c3=$?
+set -e
+# grep the guard message too, so this pins our check rather than getopt's own rejection
+[[ $c1 -eq 1 && $c2 -eq 1 && $c3 -eq 1 ]] \
+ && echo "$o1" | grep -q 'only valid with --check' \
+ && echo "$o2" | grep -q 'only valid with --check' \
+ && echo "$o3" | grep -q 'only valid with --check' \
+ && { echo " PASS: --force mutually exclusive"; (( PASS++ )); } \
+ || { echo " FAIL: exits $c1 $c2 $c3"; (( FAIL++ )); ERRORS+=("T-BM12"); }
+
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
teardown