summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lib-messages-test.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lib-messages-test.sh b/test/lib-messages-test.sh
index 3fcac63..d895d99 100644
--- a/test/lib-messages-test.sh
+++ b/test/lib-messages-test.sh
@@ -46,3 +46,19 @@ it_fails_with_msg_and_no_args() {
libremessages msg || ret=$?
[[ $ret != 0 ]]
}
+
+it_allows_subheadings_to_flag() {
+ # Note that old versions of `flag` panicked if given an odd
+ # number of headings, so give an odd number here.
+ libremessages flag \
+ -a adesc \
+ -b bdesc \
+ Head1: \
+ -c cdesc > $tmpdir/out
+ printf '%s\n' \
+ ' -a adesc' \
+ ' -b bdesc' \
+ ' Head1:' \
+ ' -c cdesc' > $tmpdir/exp
+ diff -u $tmpdir/exp $tmpdir/out
+}