summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2007-06-12 12:48:36 +0200
committerKarel Zak <kzak@redhat.com>2007-06-12 13:01:53 +0200
commitc99539b00fce225d81cdb1721a5a3a267e25b80a (patch)
tree9f20cf2bc18796ddf80aa76cde756ac33f0b1fd8 /tests
parent1d9acab1c14a4464a757dbd5d68a1bf1dca117b2 (diff)
downloadutil-linux-old-c99539b00fce225d81cdb1721a5a3a267e25b80a.tar.gz
tests: add cal -1 test
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/expected/ts-cal-137
-rwxr-xr-xtests/ts-cal-160
3 files changed, 98 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b63591f4..1cb61495 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,6 +7,7 @@ EXTRA_DIST = expected/ \
input/ \
README \
run.sh \
+ ts-cal-1 \
ts-col-multibyte \
ts-cramfs-mkfs \
ts-fstab-label \
diff --git a/tests/expected/ts-cal-1 b/tests/expected/ts-cal-1
new file mode 100644
index 00000000..882d7e9d
--- /dev/null
+++ b/tests/expected/ts-cal-1
@@ -0,0 +1,37 @@
+
+Gregorian - Monday-based week
+ September 2006
+Mo Tu We Th Fr Sa Su
+ 1 2 3
+ 4 5 6 7 8 9 10
+11 12 13 14 15 16 17
+18 19 20 21 22 23 24
+25 26 27 28 29 30
+
+Gregorian - Sunday-based week
+ September 2006
+Su Mo Tu We Th Fr Sa
+ 1 2
+ 3 4 5 6 7 8 9
+10 11 12 13 14 15 16
+17 18 19 20 21 22 23
+24 25 26 27 28 29 30
+
+Julian - Monday-based week
+ September 2006
+Mon Tue Wed Thu Fri Sat Sun
+ 244 245 246
+247 248 249 250 251 252 253
+254 255 256 257 258 259 260
+261 262 263 264 265 266 267
+268 269 270 271 272 273
+
+Julian - Sunday-based week
+ September 2006
+Sun Mon Tue Wed Thu Fri Sat
+ 244 245
+246 247 248 249 250 251 252
+253 254 255 256 257 258 259
+260 261 262 263 264 265 266
+267 268 269 270 271 272 273
+
diff --git a/tests/ts-cal-1 b/tests/ts-cal-1
new file mode 100755
index 00000000..674e4dd8
--- /dev/null
+++ b/tests/ts-cal-1
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
+#
+# This file is part of util-linux-ng.
+#
+# 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.
+#
+# 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.
+#
+
+. commands.sh
+. functions.sh
+
+TS_COMPONENT="cal"
+TS_DESC="1 month"
+
+ts_init "$*"
+
+set -o pipefail
+
+USETERM=$( ts_has_option "useterm" "$*" )
+MYTIME=1159350000
+
+[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
+ts_log ""
+
+ts_log "Gregorian - Monday-based week"
+if [ "$USETERM" == "yes" ]; then
+ TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1m
+fi
+TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1m >> $TS_OUTPUT
+
+ts_log "Gregorian - Sunday-based week"
+if [ "$USETERM" == "yes" ]; then
+ TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1s
+fi
+TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1s >> $TS_OUTPUT
+
+
+ts_log "Julian - Monday-based week"
+if [ "$USETERM" == "yes" ]; then
+ TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1mj
+fi
+TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1mj >> $TS_OUTPUT
+
+ts_log "Julian - Sunday-based week"
+if [ "$USETERM" == "yes" ]; then
+ TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1sj
+fi
+TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -1sj >> $TS_OUTPUT
+
+ts_finalize
+