1 dnl Copyright © 2015, 2021-2023 Nick Bowler
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
7 AT_BANNER([Binary packing functions])
9 TEST_TAP_SIMPLE([signed unpacking], [packtests], [], [pack])
10 TEST_TAP_SIMPLE([unsigned unpacking], [packtestu], [], [pack])
11 TEST_TAP_SIMPLE([64-bit signed unpacking], [packtests64], [], [pack])
12 TEST_TAP_SIMPLE([64-bit unsigned unpacking], [packtestu64], [], [pack])
14 AT_BANNER([Help formatting functions])
16 AT_SETUP([help_print_desc])
19 AT_SKIP_IF([test ! -x "$builddir/t/helpdesc"])
22 [[this is the first line
23 this is the second line
24 this is the third line
28 sed -e '5,$s/^/ /' -e '6,$s/^/ /' \
30 -e '13s/^ *//' -e '14,$s/^/ /' \
31 test.txt test.txt test.txt test.txt >expout
33 AT_CHECK(["$builddir/t/helpdesc" 0 0 10 5 30 20 40 40 <test.txt],
38 AT_SETUP([help_print_desc (empty description)])
41 AT_SKIP_IF([test ! -x "$builddir/t/helpdesc"])
43 AT_CHECK(["$builddir/t/helpdesc" 0 0 0 20 </dev/null])
44 AT_CHECK(["$builddir/t/helpdesc" 1 20 </dev/null], [0], [
49 AT_SETUP([help_print_optstring])
52 AT_SKIP_IF([test ! -x "$builddir/t/helpopt"])
54 AT_CHECK([m4_join([ ],
55 ["$builddir/t/helpopt"],
60 [--quux '@<:@ARG@:>@'],
61 [--quux -q '@<:@ARG@:>@'],
62 [--hello-this-is-a-very-long-option 20],
63 [--hello-this-is-a-very-long-option 50],
65 [--flagged -f \&])], [0],
72 --hello-this-is-a-very-long-option
74 --hello-this-is-a-very-long-option 36
81 AT_SETUP([help_print_optstring (getopt_long_only)])
84 AT_SKIP_IF([test ! -x "$builddir/t/helpopt2"])
86 AT_CHECK([m4_join([ ],
87 ["$builddir/t/helpopt2"],
92 [--quux '@<:@ARG@:>@'],
93 [--quux -q '@<:@ARG@:>@'],
94 [--hello-this-is-a-very-long-option 20],
95 [--hello-this-is-a-very-long-option 50],
97 [--flagged -f \&])], [0],
104 -hello-this-is-a-very-long-option
106 -hello-this-is-a-very-long-option 35
113 AT_SETUP([help_print_optstring (NLS fullwidth/halfwidth)])
114 AT_KEYWORDS([help nls])
116 AT_SKIP_IF([test ! -x "$builddir/t/helpopt3"])
117 TEST_UTF8_LOCALE([locale_utf8])
119 AT_CHECK([m4_join([ ],
120 [LC_ALL=$locale_utf8 "$builddir/t/helpopt3"],
130 AT_BANNER([Miscellaneous functions])
132 TEST_TAP_SIMPLE([copyright_symbol], [copysym], [], [])