]> err.no Git - util-linux/commitdiff
tests: add cal -1 test
authorKarel Zak <kzak@redhat.com>
Tue, 12 Jun 2007 10:48:36 +0000 (12:48 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Jun 2007 11:01:53 +0000 (13:01 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/Makefile.am
tests/expected/ts-cal-1 [new file with mode: 0644]
tests/ts-cal-1 [new file with mode: 0755]

index b63591f47c7b2a949fbd2056043fd58a1b06ecdb..1cb614957a680de4accbb9bc19387ce67a8c6d5f 100644 (file)
@@ -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 (file)
index 0000000..882d7e9
--- /dev/null
@@ -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 (executable)
index 0000000..674e4dd
--- /dev/null
@@ -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
+