]>
Commit | Line | Data |
---|---|---|
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 | 18 | TS_TOPDIR="${0%/*}/../.." |
15ec3ddf KZ |
19 | TS_DESC="year" |
20 | ||
b319621a | 21 | . $TS_TOPDIR/functions.sh |
15ec3ddf KZ |
22 | ts_init "$*" |
23 | ||
2f791546 SK |
24 | ts_check_test_command "$TS_CMD_CAL" |
25 | ||
e0e9ff9e | 26 | export TERM=linux |
15ec3ddf KZ |
27 | |
28 | USETERM=$( ts_has_option "useterm" "$*" ) | |
d7a92b89 | 29 | MYTIME="29 11 2006" |
15ec3ddf | 30 | |
5b9138d9 KZ |
31 | function 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 | ||
44 | call_cal "Gregorian - Monday-based week" -ym $MYTIME | |
45 | call_cal "Gregorian - Sunday-based week" -ys $MYTIME | |
46 | call_cal "Julian - Monday-based week" -ymj $MYTIME | |
47 | call_cal "Julian - Sunday-based week" -ysj $MYTIME | |
48 | call_cal "Gregorian - Monday-based week with week numbers" -ymw $MYTIME | |
49 | call_cal "Gregorian - Sunday-based week with week numbers" -ysw $MYTIME | |
50 | call_cal "Julian - Monday-based week with week numbers" -ymjw $MYTIME | |
51 | call_cal "Julian - Sunday-based week with week numbers" -ysjw $MYTIME | |
15ec3ddf KZ |
52 | |
53 | ts_finalize | |
54 |