]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tests/ts/cal/year
tests: merge year cal(1) tests
[thirdparty/util-linux.git] / tests / ts / cal / year
CommitLineData
15ec3ddf
KZ
1#!/bin/bash
2
3#
5b9138d9 4# Copyright (C) 2007-2018 Karel Zak <kzak@redhat.com>
15ec3ddf 5#
601d12fb 6# This file is part of util-linux.
15ec3ddf
KZ
7#
8# This file is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
92f2c23e
KZ
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
15ec3ddf
KZ
12#
13# This file is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
e130ce53 18TS_TOPDIR="${0%/*}/../.."
15ec3ddf
KZ
19TS_DESC="year"
20
b319621a 21. $TS_TOPDIR/functions.sh
15ec3ddf
KZ
22ts_init "$*"
23
2f791546
SK
24ts_check_test_command "$TS_CMD_CAL"
25
e0e9ff9e 26export TERM=linux
15ec3ddf
KZ
27
28USETERM=$( ts_has_option "useterm" "$*" )
d7a92b89 29MYTIME="29 11 2006"
15ec3ddf 30
5b9138d9
KZ
31function call_cal {
32 local testname=$(echo "$2" | sed 's/-//g')
33
34 ts_init_subtest "$testname"
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
44call_cal "Gregorian - Monday-based week" -ym $MYTIME
45call_cal "Gregorian - Sunday-based week" -ys $MYTIME
46call_cal "Julian - Monday-based week" -ymj $MYTIME
47call_cal "Julian - Sunday-based week" -ysj $MYTIME
48call_cal "Gregorian - Monday-based week with week numbers" -ymw $MYTIME
49call_cal "Gregorian - Sunday-based week with week numbers" -ysw $MYTIME
50call_cal "Julian - Monday-based week with week numbers" -ymjw $MYTIME
51call_cal "Julian - Sunday-based week with week numbers" -ysjw $MYTIME
15ec3ddf
KZ
52
53ts_finalize
54