1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
dnl -*- mode: m4; -*-
dnl vim: set filetype=m4 ts=4 sw=4 noexpandtab :
dnl
dnl Test suite for rifiuti2
AT_SETUP([Short Options])
AT_KEYWORDS([option])
_r2_chk_status_only([-?])
_r2_chk_status_only([-v])
_r2_chk_opt_status_only([-t :])
_r2_chk_opt_status_only([-n])
AT_CLEANUP
AT_SETUP([Long Options])
AT_KEYWORDS([option])
_r2_chk_status_only([--help-all])
_r2_chk_opt_status_only([--delimiter=:])
_r2_chk_opt_status_only([--no-heading])
AT_CLEANUP
AT_SETUP([Invalid options])
AT_KEYWORDS([option])
_r2_chk_opt_status_only([--invalid-option], [1])
AX_AT_CHECK_PATTERN([dnl
$progf -l foobar $sample/INFO2-sample2], [1],, [dnl
Error parsing options: 'foobar' encoding is not supported by glib library .*
https://.*
])
AT_CLEANUP
AT_SETUP([Duplicative options])
AT_KEYWORDS([option])
AT_CHECK([dnl
$progf -l ASCII -l CP1252 $sample/INFO2-sample2], [1],, [dnl
Error parsing options: Multiple encoding options disallowed.
])
_r2_chk_opt_err([-t : -t ,], [1], [dnl
Error parsing options: Multiple delimiter options disallowed.
])
_r2_chk_opt_err([-o file1 -o file2], [1], [dnl
Error parsing options: Multiple output destinations disallowed.
])
AT_CLEANUP
AT_SETUP([Options with empty arg])
AT_KEYWORDS([option])
_r2_chk_opt_err([-o ""], [1], [dnl
Error parsing options: Empty output filename disallowed.
])
AT_CHECK([dnl
$progf -l "" $sample/INFO2-sample2], [1],, [dnl
Error parsing options: Empty encoding option disallowed.
])
AT_CLEANUP
dnl TODO check stderr too
AT_SETUP([Wrong combinations])
AT_KEYWORDS([option])
_r2_chk_opt_status_only([-x -t :], [1])
_r2_chk_opt_status_only([-x -n], [1])
AT_CLEANUP
dnl TODO check stderr too
AT_SETUP([Err on no file args])
AT_KEYWORDS([file option])
_r2_chk_status_only([-x], [1])
AT_CLEANUP
dnl TODO check stderr too
AT_SETUP([Err on multiple file args])
AT_KEYWORDS([file option])
_r2_chk_status_only([foo bar baz], [1])
AT_CLEANUP
AT_SETUP([Escaped char in delimiter])
AT_KEYWORDS([option])
AT_CHECK([
$awk '{ gsub("\t","\n\t"); print; }' < $sample/INFO2-sample1.txt > expout
cd $sample
$progf -t "\n\t" INFO2-sample1
],, [expout], [])
AT_CHECK([
$awk '{ gsub("\t","\n\t"); print; }' < $sample/dir-sample1.txt > expout
cd $sample
$progd -t "\n\t" dir-sample1
],, [expout], [])
AT_CLEANUP
|