| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# |
| 4 |
# Copyright (C) 2007-2018 Karel Zak <[email protected]> |
| 5 |
# Copyright (C) 2023 Thomas Weißschuh <[email protected]> |
| 6 |
# |
| 7 |
# This file is part of util-linux. |
| 8 |
# |
| 9 |
# This file is free software; you can redistribute it and/or modify |
| 10 |
# it under the terms of the GNU General Public License as published by |
| 11 |
# the Free Software Foundation; either version 2 of the License, or |
| 12 |
# (at your option) any later version. |
| 13 |
# |
| 14 |
# This file is distributed in the hope that it will be useful, |
| 15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
# GNU General Public License for more details. |
| 18 |
# |
| 19 |
TS_TOPDIR="${0%/*}/../.." |
| 20 |
TS_DESC="year" |
| 21 |
|
| 22 |
. "$TS_TOPDIR"/functions.sh |
| 23 |
ts_init "$*" |
| 24 |
|
| 25 |
ts_check_test_command "$TS_CMD_CAL" |
| 26 |
|
| 27 |
export TERM=linux |
| 28 |
|
| 29 |
USETERM=$( ts_has_option "useterm" "$*" ) |
| 30 |
MYTIME="29 11 2006" |
| 31 |
|
| 32 |
function call_cal { |
| 33 |
|
| 34 |
ts_init_subtest "$(echo "$1" | cut -d ' ' -f 1)" |
| 35 |
ts_log "$1" |
| 36 |
shift |
| 37 |
if [ "$USETERM" == "yes" ]; then |
| 38 |
$TS_CMD_CAL "$@" |
| 39 |
fi |
| 40 |
$TS_CMD_CAL "$@" >> $TS_OUTPUT |
| 41 |
ts_finalize_subtest |
| 42 |
} |
| 43 |
|
| 44 |
call_cal "6 columns" --year --columns 6 $MYTIME |
| 45 |
call_cal "5 columns" --year --columns 5 $MYTIME |
| 46 |
call_cal "auto columns" --year --columns auto $MYTIME |
| 47 |
|
| 48 |
ts_finalize |
| 49 |
|