summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady2007-10-02 01:22:45 +0200
committerKarel Zak2007-10-11 14:19:39 +0200
commitd7a92b89944d16410c03bfc58f360f783cc435c4 (patch)
treef2be51e34688df4d0b1c5f83fb1768df6ab8f18f /tests
parenttailf: add option -n to specifying output lines (diff)
downloadkernel-qcow2-util-linux-d7a92b89944d16410c03bfc58f360f783cc435c4.tar.gz
kernel-qcow2-util-linux-d7a92b89944d16410c03bfc58f360f783cc435c4.tar.xz
kernel-qcow2-util-linux-d7a92b89944d16410c03bfc58f360f783cc435c4.zip
cal: add support for highlighting an arbitrary date
This is done by calling cal with the extra day parameter like: cal 14 9 1752 Note the tests were updated to use the new syntax. Note also that this patch changes the -y option to always print a full year, even if a month or the -[13] options are specified. This matches the cal operation from bsdmainutils on debian and also allows one to print a full year while highlighting a particular date. Signed-off-by: Pádraig Brady <P@draigBrady.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/commands.sh.in1
-rwxr-xr-xtests/ts-cal-118
-rwxr-xr-xtests/ts-cal-318
-rwxr-xr-xtests/ts-cal-y18
4 files changed, 27 insertions, 28 deletions
diff --git a/tests/commands.sh.in b/tests/commands.sh.in
index 5e0bb5041..c96a422c6 100644
--- a/tests/commands.sh.in
+++ b/tests/commands.sh.in
@@ -32,7 +32,6 @@ TS_CMD_COL=${TS_CMD_COL:-"$TOPDIR/text-utils/col"}
TS_CMD_NAMEI=${TS_CMD_NAMEI-"$TOPDIR/misc-utils/namei"}
TS_CMD_LOOK=${TS_CMD_LOOK-"$TOPDIR/misc-utils/look"}
TS_CMD_CAL=${TS_CMD_CAL-"$TOPDIR/misc-utils/cal"}
-TS_CMD_CALTEST=${TS_CMD_CALTEST-"$TOPDIR/misc-utils/cal_test"}
TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$TOPDIR/misc-utils/script"}
TS_CMD_CHECKTTY=${TS_CMD_CHECKTTY-"$TOPDIR/login-utils/checktty_test"}
diff --git a/tests/ts-cal-1 b/tests/ts-cal-1
index 414cc831c..53a1395ea 100755
--- a/tests/ts-cal-1
+++ b/tests/ts-cal-1
@@ -26,35 +26,35 @@ ts_init "$*"
set -o pipefail
USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME=1159350000
+MYTIME="27 09 2006"
[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
ts_log ""
ts_log "Gregorian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -1m
+ $TS_CMD_CAL -1m $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -1m >> $TS_OUTPUT
+$TS_CMD_CAL -1m $MYTIME >> $TS_OUTPUT
ts_log "Gregorian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -1s
+ $TS_CMD_CAL -1s $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -1s >> $TS_OUTPUT
+$TS_CMD_CAL -1s $MYTIME >> $TS_OUTPUT
ts_log "Julian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -1mj
+ $TS_CMD_CAL -1mj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -1mj >> $TS_OUTPUT
+$TS_CMD_CAL -1mj $MYTIME >> $TS_OUTPUT
ts_log "Julian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -1sj
+ $TS_CMD_CAL -1sj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -1sj >> $TS_OUTPUT
+$TS_CMD_CAL -1sj $MYTIME >> $TS_OUTPUT
ts_finalize
diff --git a/tests/ts-cal-3 b/tests/ts-cal-3
index 877c194e7..aa815f586 100755
--- a/tests/ts-cal-3
+++ b/tests/ts-cal-3
@@ -26,35 +26,35 @@ ts_init "$*"
set -o pipefail
USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME=1159350000
+MYTIME="27 09 2006"
[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
ts_log ""
ts_log "Gregorian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -3m
+ $TS_CMD_CAL -3m $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -3m >> $TS_OUTPUT
+$TS_CMD_CAL -3m $MYTIME >> $TS_OUTPUT
ts_log "Gregorian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -3s
+ $TS_CMD_CAL -3s $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -3s >> $TS_OUTPUT
+$TS_CMD_CAL -3s $MYTIME >> $TS_OUTPUT
ts_log "Julian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -3mj
+ $TS_CMD_CAL -3mj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -3mj >> $TS_OUTPUT
+$TS_CMD_CAL -3mj $MYTIME >> $TS_OUTPUT
ts_log "Julian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -3sj
+ $TS_CMD_CAL -3sj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -3sj >> $TS_OUTPUT
+$TS_CMD_CAL -3sj $MYTIME >> $TS_OUTPUT
ts_finalize
diff --git a/tests/ts-cal-y b/tests/ts-cal-y
index 4a18445d3..769373a90 100755
--- a/tests/ts-cal-y
+++ b/tests/ts-cal-y
@@ -26,35 +26,35 @@ ts_init "$*"
set -o pipefail
USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME=1164800000 # 29-Nov-2006
+MYTIME="29 11 2006"
[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
ts_log ""
ts_log "Gregorian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -ym
+ $TS_CMD_CAL -ym $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -ym >> $TS_OUTPUT
+$TS_CMD_CAL -ym $MYTIME >> $TS_OUTPUT
ts_log "Gregorian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -ys
+ $TS_CMD_CAL -ys $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -ys >> $TS_OUTPUT
+$TS_CMD_CAL -ys $MYTIME >> $TS_OUTPUT
ts_log "Julian - Monday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -ymj
+ $TS_CMD_CAL -ymj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -ymj >> $TS_OUTPUT
+$TS_CMD_CAL -ymj $MYTIME >> $TS_OUTPUT
ts_log "Julian - Sunday-based week"
if [ "$USETERM" == "yes" ]; then
- TEST_TIME=$MYTIME $TS_CMD_CALTEST -ysj
+ $TS_CMD_CAL -ysj $MYTIME
fi
-TEST_TIME=$MYTIME $TS_CMD_CALTEST -ysj >> $TS_OUTPUT
+$TS_CMD_CAL -ysj $MYTIME >> $TS_OUTPUT
ts_finalize