From 15ec3ddf1993d114758f105dfa46c734d334e5fa Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 12 Jun 2007 13:26:05 +0200 Subject: [PATCH] tests: add cal -y test Signed-off-by: Karel Zak --- tests/Makefile.am | 1 + tests/expected/ts-cal-y | 177 ++++++++++++++++++++++++++++++++++++++++ tests/ts-cal-y | 60 ++++++++++++++ 3 files changed, 238 insertions(+) create mode 100644 tests/expected/ts-cal-y create mode 100755 tests/ts-cal-y diff --git a/tests/Makefile.am b/tests/Makefile.am index 666c580d..ff25c513 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,6 +9,7 @@ EXTRA_DIST = expected/ \ run.sh \ ts-cal-1 \ ts-cal-3 \ + ts-cal-y \ ts-col-multibyte \ ts-cramfs-mkfs \ ts-fstab-label \ diff --git a/tests/expected/ts-cal-y b/tests/expected/ts-cal-y new file mode 100644 index 00000000..0bc4a2ea --- /dev/null +++ b/tests/expected/ts-cal-y @@ -0,0 +1,177 @@ + +Gregorian - Monday-based week + 2006 + + January February March +Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su + 1 1 2 3 4 5 1 2 3 4 5 + 2 3 4 5 6 7 8 6 7 8 9 10 11 12 6 7 8 9 10 11 12 + 9 10 11 12 13 14 15 13 14 15 16 17 18 19 13 14 15 16 17 18 19 +16 17 18 19 20 21 22 20 21 22 23 24 25 26 20 21 22 23 24 25 26 +23 24 25 26 27 28 29 27 28 27 28 29 30 31 +30 31 + April May June +Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su + 1 2 1 2 3 4 5 6 7 1 2 3 4 + 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11 +10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18 +17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25 +24 25 26 27 28 29 30 29 30 31 26 27 28 29 30 + + July August September +Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su + 1 2 1 2 3 4 5 6 1 2 3 + 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10 +10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17 +17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24 +24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30 +31 + October November December +Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su + 1 1 2 3 4 5 1 2 3 + 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10 + 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17 +16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24 +23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31 +30 31 + +Gregorian - Sunday-based week + 2006 + + January February March +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 6 7 1 2 3 4 1 2 3 4 + 8 9 10 11 12 13 14 5 6 7 8 9 10 11 5 6 7 8 9 10 11 +15 16 17 18 19 20 21 12 13 14 15 16 17 18 12 13 14 15 16 17 18 +22 23 24 25 26 27 28 19 20 21 22 23 24 25 19 20 21 22 23 24 25 +29 30 31 26 27 28 26 27 28 29 30 31 + + April May June +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 1 2 3 4 5 6 1 2 3 + 2 3 4 5 6 7 8 7 8 9 10 11 12 13 4 5 6 7 8 9 10 + 9 10 11 12 13 14 15 14 15 16 17 18 19 20 11 12 13 14 15 16 17 +16 17 18 19 20 21 22 21 22 23 24 25 26 27 18 19 20 21 22 23 24 +23 24 25 26 27 28 29 28 29 30 31 25 26 27 28 29 30 +30 + July August September +Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa + 1 1 2 3 4 5 1 2 + 2 3 4 5 6 7 8 6 7 8 9 10 11 12 3 4 5 6 7 8 9 + 9 10 11 12 13 14 15 13 14 15 16 17 18 19 10 11 12 13 14 15 16 +16 17 18 19 20 21 22 20 21 22 23 24 25 26 17 18 19 20 21 22 23 +23 24 25 26 27 28 29 27 28 29 30 31 24 25 26 27 28 29 30 +30 31 + October November December +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 6 7 1 2 3 4 1 2 + 8 9 10 11 12 13 14 5 6 7 8 9 10 11 3 4 5 6 7 8 9 +15 16 17 18 19 20 21 12 13 14 15 16 17 18 10 11 12 13 14 15 16 +22 23 24 25 26 27 28 19 20 21 22 23 24 25 17 18 19 20 21 22 23 +29 30 31 26 27 28 29 30 24 25 26 27 28 29 30 + 31 + +Julian - Monday-based week + 2006 + + January February +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 1 32 33 34 35 36 + 2 3 4 5 6 7 8 37 38 39 40 41 42 43 + 9 10 11 12 13 14 15 44 45 46 47 48 49 50 + 16 17 18 19 20 21 22 51 52 53 54 55 56 57 + 23 24 25 26 27 28 29 58 59 + 30 31 + March April +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 60 61 62 63 64 91 92 + 65 66 67 68 69 70 71 93 94 95 96 97 98 99 + 72 73 74 75 76 77 78 100 101 102 103 104 105 106 + 79 80 81 82 83 84 85 107 108 109 110 111 112 113 + 86 87 88 89 90 114 115 116 117 118 119 120 + + May June +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun +121 122 123 124 125 126 127 152 153 154 155 +128 129 130 131 132 133 134 156 157 158 159 160 161 162 +135 136 137 138 139 140 141 163 164 165 166 167 168 169 +142 143 144 145 146 147 148 170 171 172 173 174 175 176 +149 150 151 177 178 179 180 181 + + July August +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 182 183 213 214 215 216 217 218 +184 185 186 187 188 189 190 219 220 221 222 223 224 225 +191 192 193 194 195 196 197 226 227 228 229 230 231 232 +198 199 200 201 202 203 204 233 234 235 236 237 238 239 +205 206 207 208 209 210 211 240 241 242 243 +212 + September October +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 244 245 246 274 +247 248 249 250 251 252 253 275 276 277 278 279 280 281 +254 255 256 257 258 259 260 282 283 284 285 286 287 288 +261 262 263 264 265 266 267 289 290 291 292 293 294 295 +268 269 270 271 272 273 296 297 298 299 300 301 302 + 303 304 + November December +Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun + 305 306 307 308 309 335 336 337 +310 311 312 313 314 315 316 338 339 340 341 342 343 344 +317 318 319 320 321 322 323 345 346 347 348 349 350 351 +324 325 326 327 328 329 330 352 353 354 355 356 357 358 +331 332 333 334 359 360 361 362 363 364 365 + + +Julian - Sunday-based week + 2006 + + January February +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 1 2 3 4 5 6 7 32 33 34 35 + 8 9 10 11 12 13 14 36 37 38 39 40 41 42 + 15 16 17 18 19 20 21 43 44 45 46 47 48 49 + 22 23 24 25 26 27 28 50 51 52 53 54 55 56 + 29 30 31 57 58 59 + + March April +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 60 61 62 63 91 + 64 65 66 67 68 69 70 92 93 94 95 96 97 98 + 71 72 73 74 75 76 77 99 100 101 102 103 104 105 + 78 79 80 81 82 83 84 106 107 108 109 110 111 112 + 85 86 87 88 89 90 113 114 115 116 117 118 119 + 120 + May June +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 121 122 123 124 125 126 152 153 154 +127 128 129 130 131 132 133 155 156 157 158 159 160 161 +134 135 136 137 138 139 140 162 163 164 165 166 167 168 +141 142 143 144 145 146 147 169 170 171 172 173 174 175 +148 149 150 151 176 177 178 179 180 181 + + July August +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 182 213 214 215 216 217 +183 184 185 186 187 188 189 218 219 220 221 222 223 224 +190 191 192 193 194 195 196 225 226 227 228 229 230 231 +197 198 199 200 201 202 203 232 233 234 235 236 237 238 +204 205 206 207 208 209 210 239 240 241 242 243 +211 212 + September October +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 244 245 274 275 276 277 278 279 280 +246 247 248 249 250 251 252 281 282 283 284 285 286 287 +253 254 255 256 257 258 259 288 289 290 291 292 293 294 +260 261 262 263 264 265 266 295 296 297 298 299 300 301 +267 268 269 270 271 272 273 302 303 304 + + November December +Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat + 305 306 307 308 335 336 +309 310 311 312 313 314 315 337 338 339 340 341 342 343 +316 317 318 319 320 321 322 344 345 346 347 348 349 350 +323 324 325 326 327 328 329 351 352 353 354 355 356 357 +330 331 332 333 334 358 359 360 361 362 363 364 + 365 + diff --git a/tests/ts-cal-y b/tests/ts-cal-y new file mode 100755 index 00000000..253bec23 --- /dev/null +++ b/tests/ts-cal-y @@ -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="year" + +ts_init "$*" + +set -o pipefail + +USETERM=$( ts_has_option "useterm" "$*" ) +MYTIME=1164800000 # 29-Nov-2006 + +[ "$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 -ym +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ym >> $TS_OUTPUT + +ts_log "Gregorian - Sunday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ys +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ys >> $TS_OUTPUT + + +ts_log "Julian - Monday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ymj +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ymj >> $TS_OUTPUT + +ts_log "Julian - Sunday-based week" +if [ "$USETERM" == "yes" ]; then + TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ysj +fi +TEST_TIME=$MYTIME LD_PRELOAD=$TS_HELPER_LIBPRELOAD_TIME $TS_CMD_CAL -ysj >> $TS_OUTPUT + +ts_finalize + -- 2.39.5