]> git.draconx.ca Git - dxcommon.git/blobdiff - tests/functions.at
help: Perform some suffix merging.
[dxcommon.git] / tests / functions.at
index e1d556b0a71d59e697f14c3701f23b9fb33faa0a..6b092a0e17fe70a0fc11659365b29dba9b261a3f 100644 (file)
@@ -33,6 +33,11 @@ sed -e '5,$s/^/     /' -e '6,$s/^/     /' \
 AT_CHECK(["$builddir/t/helpdesc" 0 0 10 5 30 20 40 40 <test.txt],
   [0], [expout])
 
+AT_CHECK([AS_ECHO_N(["no trailing newline"]) |
+  "$builddir/t/helpdesc" 0 0], [0],
+[no trailing newline
+])
+
 AT_CLEANUP
 
 AT_SETUP([help_print_desc (empty description)])
@@ -40,7 +45,9 @@ AT_KEYWORDS([help])
 
 AT_SKIP_IF([test ! -x "$builddir/t/helpdesc"])
 
-AT_CHECK(["$builddir/t/helpdesc" 0 0 0 20 </dev/null])
+AT_CHECK(["$builddir/t/helpdesc" 0 0 0 20 </dev/null], [0], [
+
+])
 AT_CHECK(["$builddir/t/helpdesc" 1 20 </dev/null], [0], [
 ])
 
@@ -63,17 +70,17 @@ AT_CHECK([m4_join([ ],
   [--hello-this-is-a-very-long-option 50],
   [--not-long 12],
   [--flagged -f \&])], [0],
-[[  --foo      7
-  -b, --bar    11
-  --baz=ARG    11
-  -B, --baz=ARG        15
-  --quux[=ARG] 14
-  -q, --quux[=ARG]     18
 --hello-this-is-a-very-long-option
+[[ --foo       6
+ -b, --bar     10
+ --baz=ARG     10
+ -B, --baz=ARG 14
+ --quux[=ARG]  13
+ -q, --quux[=ARG]      17
+ --hello-this-is-a-very-long-option
        0
-  --hello-this-is-a-very-long-option   36
-  --not-long   12
-  --flagged    11
+ --hello-this-is-a-very-long-option    35
+ --not-long    11
+ --flagged     10
 ]])
 
 AT_CLEANUP
@@ -95,17 +102,17 @@ AT_CHECK([m4_join([ ],
   [--hello-this-is-a-very-long-option 50],
   [--not-long 12],
   [--flagged -f \&])], [0],
-[[  -foo       6
-  -bar 6
-  -baz ARG     10
-  -baz ARG     10
-  -quux [ARG]  13
-  -quux [ARG]  13
 -hello-this-is-a-very-long-option
+[[ -foo        5
+ -bar  5
+ -baz ARG      9
+ -baz ARG      9
+ -quux [ARG]   12
+ -quux [ARG]   12
+ -hello-this-is-a-very-long-option
        0
-  -hello-this-is-a-very-long-option    35
-  -not-long    11
-  -flagged     10
+ -hello-this-is-a-very-long-option     34
+ -not-long     10
+ -flagged      9
 ]])
 
 AT_CLEANUP
@@ -125,8 +132,8 @@ BEGIN {
 
   print zenkaku, hankaku >"args"
 
-  print "  " zenkaku "\t" "8"
-  print "  " hankaku "\t" "8"
+  print " " zenkaku "\t" "7"
+  print " " hankaku "\t" "7"
 }
 EOF