Debian Codegraph @

tests/ts/cal/year

raw
1 #!/bin/bash
2
3 #
4 # Copyright (C) 2007-2018 Karel Zak <[email protected]>
5 #
6 # This file is part of util-linux.
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
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
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 #
18 TS_TOPDIR="${0%/*}/../.."
19 TS_DESC="year"
20
21 . "$TS_TOPDIR"/functions.sh
22 ts_init "$*"
23
24 ts_check_test_command "$TS_CMD_CAL"
25
26 export TERM=linux
27
28 USETERM=$( ts_has_option "useterm" "$*" )
29 MYTIME="29 11 2006"
30
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
52
53 ts_finalize
54