diff options
Diffstat (limited to 'tests/formats.sh')
-rwxr-xr-x | tests/formats.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/formats.sh b/tests/formats.sh new file mode 100755 index 0000000..576b96a --- /dev/null +++ b/tests/formats.sh @@ -0,0 +1,43 @@ +# Tests `@ -F` output +# +# Copyright (C) 2022 P. J. McDermott +# +# This file is part of @ +# +# @ is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# @ is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with @. If not, see <http://www.gnu.org/licenses/>. + +set -eu + +. "${TOP_SRCDIR}/tests/aux/tap-functions.sh" + +plan_ 1 + +exp="$(cat "${0%.sh}.exp")" +got="$("${TOP_BUILDDIR}/atsign" -d '1970-01-02 03:04:05' -F)" + +if [ x"${got}" = x"${exp}" ]; then + ok_ -- 'formats list' + exit 0 +fi +not_ok_ -- 'formats list' + +IFS=' +' + +for line in $(printf '%s\n' "${got}" | diff -u "${0%.sh}.exp" '-' | sed '1,2d') +do + diag_ "${line}" +done + +exit 0 |