summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-07-09 12:24:20 +0200
committerDanilo M. <danix@danix.xyz>2026-07-09 12:24:20 +0200
commit15358714547804abb9227570a03c8fb3c4e801ec (patch)
tree47239eba8d9d06de812defc5c020f6c9c5127b61
parentd6877f911f3c52feaa9678aa7059c619621deeca (diff)
downloadmkhintfile-15358714547804abb9227570a03c8fb3c4e801ec.tar.gz
mkhintfile-15358714547804abb9227570a03c8fb3c4e801ec.zip
fix: newline before closing fence in nvchecker stanza echov1.2.5
The body branch used printf '%s' (no trailing newline) so the closing fence glued onto the last body line. Use printf '%s\n'. Regression test T16 asserts the fence sits on its own line. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-rwxr-xr-xmkhint2
-rwxr-xr-xtests/mkhint_test.sh3
2 files changed, 4 insertions, 1 deletions
diff --git a/mkhint b/mkhint
index 5bb3a69..1d7c86d 100755
--- a/mkhint
+++ b/mkhint
@@ -1041,7 +1041,7 @@ EOF
echo "────────────────────────────"
printf '%s\n' "$label"
if [[ -n "$body" ]]; then
- printf '%s' "$body"
+ printf '%s\n' "$body"
else
echo "# TODO: configure nvchecker source for \"${pkg}\""
fi
diff --git a/tests/mkhint_test.sh b/tests/mkhint_test.sh
index 2af6188..8a8bd08 100755
--- a/tests/mkhint_test.sh
+++ b/tests/mkhint_test.sh
@@ -581,6 +581,9 @@ assert_contains "github owner/repo" "$MOCK_BASE/nvchecker.toml" 'github = "
assert_contains "github latest_release" "$MOCK_BASE/nvchecker.toml" 'use_latest_release = true'
assert_contains "github max_tag comment" "$MOCK_BASE/nvchecker.toml" '# use_max_tag = true'
assert_contains "T16 stanza echoed" "$MOCK_BASE/t16.out" 'source = "github"'
+# closing fence must sit on its own line, not glued to the last body line
+assert_contains "T16 closing fence on own line" "$MOCK_BASE/t16.out" '^────────────────────────────$'
+assert_contains "T16 prefix line intact" "$MOCK_BASE/t16.out" 'uncomment if tags are v-prefixed$'
# ── T17: --new pypi .info → pypi source section ───────────────────────────────
echo ""