summaryrefslogtreecommitdiffstats
path: root/tests/ts/cal
diff options
context:
space:
mode:
authorSami Kerola2013-05-02 20:16:47 +0200
committerSami Kerola2013-05-26 10:59:19 +0200
commitf35ece141e1cade1b5029047fa0e9200301fa099 (patch)
tree6ab9fd48d81e4a23e6e49188b4f353137dee4029 /tests/ts/cal
parentdocs: cal: add --color option description to manual page (diff)
downloadkernel-qcow2-util-linux-f35ece141e1cade1b5029047fa0e9200301fa099.tar.gz
kernel-qcow2-util-linux-f35ece141e1cade1b5029047fa0e9200301fa099.tar.xz
kernel-qcow2-util-linux-f35ece141e1cade1b5029047fa0e9200301fa099.zip
tests: add cal day color corner cases
Check that the first, andn last, possible dates and strange Sep 1752 dates are highlighted correctly. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'tests/ts/cal')
-rwxr-xr-xtests/ts/cal/color68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/ts/cal/color b/tests/ts/cal/color
new file mode 100755
index 000000000..f10c66fa1
--- /dev/null
+++ b/tests/ts/cal/color
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+#
+# This file is part of util-linux.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="color"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+set -o pipefail
+
+USETERM=$( ts_has_option "useterm" "$*" )
+
+[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
+ts_log ""
+
+ts_log "First day"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 1 1 1
+fi
+$TS_CMD_CAL --color=always 1 1 1 >> $TS_OUTPUT
+
+ts_log "Reformation corner cases 1"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 2 9 1752
+fi
+$TS_CMD_CAL --color=always 2 9 1752 >> $TS_OUTPUT
+
+ts_log "Reformation corner cases 2"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 3 9 1752
+fi
+$TS_CMD_CAL --color=always 3 9 1752 >> $TS_OUTPUT
+
+ts_log "Reformation corner cases 3"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 13 9 1752
+fi
+$TS_CMD_CAL --color=always 13 9 1752 >> $TS_OUTPUT
+
+ts_log "Reformation corner cases 4"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 14 9 1752
+fi
+$TS_CMD_CAL --color=always 14 9 1752 >> $TS_OUTPUT
+
+ts_log "Last day"
+if [ "$USETERM" == "yes" ]; then
+ $TS_CMD_CAL --color=always 31 12 9999
+fi
+$TS_CMD_CAL --color=always -3 31 12 9999 >> $TS_OUTPUT
+
+
+ts_finalize
+