Skip to content

Commit

Permalink
t/help: ensure zsh completion and man page are in sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilk committed Apr 15, 2024
1 parent fb99f03 commit afc9671
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions completion/zsh/_ubanner
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Copyright © 2024 Christopher Bock <[email protected]>
# SPDX-License-Identifier: MIT

# SHA-256(help) = 3b402f915db43ab07d8699098cf5746bc6ce7768d32cf74cc9dac4b5ea3ee78b

local arguments

arguments=(
Expand Down
2 changes: 2 additions & 0 deletions doc/ubanner.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.\" Copyright © 2024 Jakub Wilk <[email protected]>
.\" SPDX-License-Identifier: MIT

.\" SHA-256(help) = 3b402f915db43ab07d8699098cf5746bc6ce7768d32cf74cc9dac4b5ea3ee78b

.TH UBANNER 1 2024-03-23 "ubanner 0.1"
.SH NAME
ubanner \- Unicode-enabled banner(1)-like program
Expand Down
22 changes: 21 additions & 1 deletion t/help.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e -u

. "${0%/*}/common.sh"

echo 1..1
echo 1..3
xout=$(
< "$dir/README" \
grep '^ [$] ubanner --help$' -A999 |
Expand All @@ -28,5 +28,25 @@ else
sed -e 's/^/# /' <<< "$diff"
echo 'not ok 1'
fi
xsum=$(sha256sum <<< "$out")
xsum=${xsum%% *}
var='SHA-256(help)'
echo "# $var = $xsum"
declare -i n=2
t_sync()
{
path="$1"
line=$(grep -F " $var = " < "$dir/$path")
sum=${line##*" $var = "}
if [[ $sum = $xsum ]]
then
echo ok $n "$path"
else
echo not ok $n "$path"
fi
n+=1
}
t_sync 'completion/zsh/_ubanner'
t_sync 'doc/ubanner.1'

# vim:ts=4 sts=4 sw=4 et ft=sh

0 comments on commit afc9671

Please sign in to comment.