From: Karel Zak Date: Tue, 12 Jun 2007 11:05:00 +0000 (+0200) Subject: tests: add cal -3 test X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a150a4a4eec491b0ffd46c44e1e991f3ea3d0bc5;p=util-linux tests: add cal -3 test Signed-off-by: Karel Zak --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 1cb61495..666c580d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ EXTRA_DIST = expected/ \ README \ run.sh \ ts-cal-1 \ + ts-cal-3 \ ts-col-multibyte \ ts-cramfs-mkfs \ ts-fstab-label \ diff --git a/tests/expected/ts-cal-3 b/tests/expected/ts-cal-3 new file mode 100644 index 00000000..06489167 --- /dev/null +++ b/tests/expected/ts-cal-3 @@ -0,0 +1,37 @@ + +Gregorian - Monday-based week + August 2006 September 2006 October 2006 +Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su + 1 2 3 4 5 6 1 2 3 1 + 7 8 9 10 11 12 13 4 5 6 7 8 9 10 2 3 4 5 6 7 8 +14 15 16 17 18 19 20 11 12 13 14 15 16 17 9 10 11 12 13 14 15 +21 22 23 24 25 26 27 18 19 20 21 22 23 24 16 17 18 19 20 21 22 +28 29 30 31 25 26 27 28 29 30 23 24 25 26 27 28 29 + 30 31 +Gregorian - Sunday-based week + August 2006 September 2006 October 2006 +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 2 3 4 5 1 2 1 2 3 4 5 6 7 + 6 7 8 9 10 11 12 3 4 5 6 7 8 9 8 9 10 11 12 13 14 +13 14 15 16 17 18 19 10 11 12 13 14 15 16 15 16 17 18 19 20 21 +20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28 +27 28 29 30 31 24 25 26 27 28 29 30 29 30 31 + +Julian - Monday-based week + August 2006 September 2006 October 2006 +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 213 214 215 216 217 218 244 245 246 274 +219 220 221 222 223 224 225 247 248 249 250 251 252 253 275 276 277 278 279 280 281 +226 227 228 229 230 231 232 254 255 256 257 258 259 260 282 283 284 285 286 287 288 +233 234 235 236 237 238 239 261 262 263 264 265 266 267 289 290 291 292 293 294 295 +240 241 242 243 268 269 270 271 272 273 296 297 298 299 300 301 302 + 303 304 +Julian - Sunday-based week + August 2006 September 2006 October 2006 +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 213 214 215 216 217 244 245 274 275 276 277 278 279 280 +218 219 220 221 222 223 224 246 247 248 249 250 251 252 281 282 283 284 285 286 287 +225 226 227 228 229 230 231 253 254 255 256 257 258 259 288 289 290 291 292 293 294 +232 233 234 235 236 237 238 260 261 262 263 264 265 266 295 296 297 298 299 300 301 +239 240 241 242 243 267 268 269 270 271 272 273 302 303 304 + diff --git a/tests/ts-cal-3 b/tests/ts-cal-3 new file mode 100755 index 00000000..eeb6e0e1 --- /dev/null +++ b/tests/ts-cal-3 @@ -0,0 +1,60 @@ +#!/bin/bash + +# +# Copyright (C) 2007 Karel Zak +# +# 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="3 months" + +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 -3m +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3m >> $TS_OUTPUT + +ts_log "Gregorian - Sunday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3s +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3s >> $TS_OUTPUT + + +ts_log "Julian - Monday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3mj +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3mj >> $TS_OUTPUT + +ts_log "Julian - Sunday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3sj +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -3sj >> $TS_OUTPUT + +ts_finalize +