]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/cal/sep1752w
3 # This file is part of util-linux.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This file is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 TS_TOPDIR
="${0%/*}/../.."
16 TS_DESC
="September 1752 with week numbers"
18 .
$TS_TOPDIR/functions.sh
21 ts_check_test_command
"$TS_CMD_CAL"
25 USETERM
=$
( ts_has_option
"useterm" "$*" )
29 function call_cal_simple
{
32 if [ "$USETERM" == "yes" ]; then
35 $TS_CMD_CAL "$@" >> $TS_OUTPUT
39 local testname
=$
(echo "$2" |
sed 's/-//g')
41 if [ "$3" == "$MYYEAR" ]; then
42 testname
="${testname}-year"
44 testname
="${testname}-month"
47 ts_init_subtest
"$testname"
53 call_cal
"Gregorian - Monday-based month with week numbers" -1mw $MYMONTH
55 call_cal
"Gregorian - Sunday-based month with week numbers" -1sw $MYMONTH
57 call_cal
"Julian - Monday-based month with week numbers" -1mjw $MYMONTH
59 call_cal
"Julian - Sunday-based month with week numbers" -1sjw $MYMONTH
61 call_cal
"Gregorian - Monday-based three months with week numbers" -3mw $MYMONTH
63 call_cal
"Gregorian - Sunday-based three months with week numbers" -3sw $MYMONTH
65 call_cal
"Julian - Monday-based three months with week numbers" -3mjw $MYMONTH
67 call_cal
"Julian - Sunday-based three months with week numbers" -3sjw $MYMONTH
69 call_cal
"Gregorian - Monday-based year with week numbers" -1mw $MYYEAR
71 call_cal
"Gregorian - Sunday-based year with week numbers" -1sw $MYYEAR
73 call_cal
"Julian - Monday-based year with week numbers" -1mjw $MYYEAR
75 call_cal
"Julian - Sunday-based year with week numbers" -1sjw $MYYEAR
77 ts_init_subtest
"week-iso"
78 call_cal_simple
"Gregorian - address by week number" --week=40 --iso $MYYEAR