]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: merge 1m and 3m cal(1) tests
authorKarel Zak <kzak@redhat.com>
Mon, 22 Jan 2018 14:53:00 +0000 (15:53 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 22 Jan 2018 15:01:06 +0000 (16:01 +0100)
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
25 files changed:
tests/expected/cal/1m [deleted file]
tests/expected/cal/1mw [deleted file]
tests/expected/cal/3m [deleted file]
tests/expected/cal/3mw [deleted file]
tests/expected/cal/month-1m [new file with mode: 0644]
tests/expected/cal/month-1mj [new file with mode: 0644]
tests/expected/cal/month-1mjw [new file with mode: 0644]
tests/expected/cal/month-1mw [new file with mode: 0644]
tests/expected/cal/month-1s [new file with mode: 0644]
tests/expected/cal/month-1sj [new file with mode: 0644]
tests/expected/cal/month-1sjw [new file with mode: 0644]
tests/expected/cal/month-1sw [new file with mode: 0644]
tests/expected/cal/month-3m [new file with mode: 0644]
tests/expected/cal/month-3mj [new file with mode: 0644]
tests/expected/cal/month-3mjw [new file with mode: 0644]
tests/expected/cal/month-3mw [new file with mode: 0644]
tests/expected/cal/month-3s [new file with mode: 0644]
tests/expected/cal/month-3sj [new file with mode: 0644]
tests/expected/cal/month-3sjw [new file with mode: 0644]
tests/expected/cal/month-3sw [new file with mode: 0644]
tests/ts/cal/1m [deleted file]
tests/ts/cal/1mw [deleted file]
tests/ts/cal/3m [deleted file]
tests/ts/cal/3mw [deleted file]
tests/ts/cal/month [new file with mode: 0755]

diff --git a/tests/expected/cal/1m b/tests/expected/cal/1m
deleted file mode 100644 (file)
index afe7f71..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-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/expected/cal/1mw b/tests/expected/cal/1mw
deleted file mode 100644 (file)
index e2980e6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-Gregorian - Monday-based week with week numbers
-     September 2006    
-   Mo Tu We Th Fr Sa Su
-35              1  2  3 
-36  4  5  6  7  8  9 10 
-37 11 12 13 14 15 16 17 
-38 18 19 20 21 22 23 24 
-39 25 26 27 28 29 30    
-                        
-Gregorian - Sunday-based week with week numbers
-     September 2006    
-   Su Mo Tu We Th Fr Sa
-35                 1  2 
-36  3  4  5  6  7  8  9 
-37 10 11 12 13 14 15 16 
-38 17 18 19 20 21 22 23 
-39 24 25 26 27 28 29 30 
-                        
-Julian - Monday-based week with week numbers
-        September 2006        
-   Mon Tue Wed Thu Fri Sat Sun
-35                 244 245 246 
-36 247 248 249 250 251 252 253 
-37 254 255 256 257 258 259 260 
-38 261 262 263 264 265 266 267 
-39 268 269 270 271 272 273     
-                               
-Julian - Sunday-based week with week numbers
-        September 2006        
-   Sun Mon Tue Wed Thu Fri Sat
-35                     244 245 
-36 246 247 248 249 250 251 252 
-37 253 254 255 256 257 258 259 
-38 260 261 262 263 264 265 266 
-39 267 268 269 270 271 272 273 
-                               
diff --git a/tests/expected/cal/3m b/tests/expected/cal/3m
deleted file mode 100644 (file)
index 21b6d31..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-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/expected/cal/3mw b/tests/expected/cal/3mw
deleted file mode 100644 (file)
index 0afea44..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-
-Gregorian - Monday-based week with week numbers
-      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
-31     1  2  3  4  5  6  35              1  2  3  39                    1 
-32  7  8  9 10 11 12 13  36  4  5  6  7  8  9 10  40  2  3  4  5  6  7  8 
-33 14 15 16 17 18 19 20  37 11 12 13 14 15 16 17  41  9 10 11 12 13 14 15 
-34 21 22 23 24 25 26 27  38 18 19 20 21 22 23 24  42 16 17 18 19 20 21 22 
-35 28 29 30 31           39 25 26 27 28 29 30     43 23 24 25 26 27 28 29 
-                                                  44 30 31                
-Gregorian - Sunday-based week with week numbers
-      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
-31        1  2  3  4  5  35                 1  2  40  1  2  3  4  5  6  7 
-32  6  7  8  9 10 11 12  36  3  4  5  6  7  8  9  41  8  9 10 11 12 13 14 
-33 13 14 15 16 17 18 19  37 10 11 12 13 14 15 16  42 15 16 17 18 19 20 21 
-34 20 21 22 23 24 25 26  38 17 18 19 20 21 22 23  43 22 23 24 25 26 27 28 
-35 27 28 29 30 31        39 24 25 26 27 28 29 30  44 29 30 31             
-                                                                          
-Julian - Monday-based week with week numbers
-          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
-31     213 214 215 216 217 218  35                 244 245 246  39                         274 
-32 219 220 221 222 223 224 225  36 247 248 249 250 251 252 253  40 275 276 277 278 279 280 281 
-33 226 227 228 229 230 231 232  37 254 255 256 257 258 259 260  41 282 283 284 285 286 287 288 
-34 233 234 235 236 237 238 239  38 261 262 263 264 265 266 267  42 289 290 291 292 293 294 295 
-35 240 241 242 243              39 268 269 270 271 272 273      43 296 297 298 299 300 301 302 
-                                                                44 303 304                     
-Julian - Sunday-based week with week numbers
-          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
-31         213 214 215 216 217  35                     244 245  40 274 275 276 277 278 279 280 
-32 218 219 220 221 222 223 224  36 246 247 248 249 250 251 252  41 281 282 283 284 285 286 287 
-33 225 226 227 228 229 230 231  37 253 254 255 256 257 258 259  42 288 289 290 291 292 293 294 
-34 232 233 234 235 236 237 238  38 260 261 262 263 264 265 266  43 295 296 297 298 299 300 301 
-35 239 240 241 242 243          39 267 268 269 270 271 272 273  44 302 303 304                 
-                                                                                               
diff --git a/tests/expected/cal/month-1m b/tests/expected/cal/month-1m
new file mode 100644 (file)
index 0000000..a740963
--- /dev/null
@@ -0,0 +1,9 @@
+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    
+                     
diff --git a/tests/expected/cal/month-1mj b/tests/expected/cal/month-1mj
new file mode 100644 (file)
index 0000000..a6bc2fc
--- /dev/null
@@ -0,0 +1,9 @@
+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     
+                            
diff --git a/tests/expected/cal/month-1mjw b/tests/expected/cal/month-1mjw
new file mode 100644 (file)
index 0000000..f728e0a
--- /dev/null
@@ -0,0 +1,9 @@
+Julian - Monday-based week with week numbers
+        September 2006        
+   Mon Tue Wed Thu Fri Sat Sun
+35                 244 245 246 
+36 247 248 249 250 251 252 253 
+37 254 255 256 257 258 259 260 
+38 261 262 263 264 265 266 267 
+39 268 269 270 271 272 273     
+                               
diff --git a/tests/expected/cal/month-1mw b/tests/expected/cal/month-1mw
new file mode 100644 (file)
index 0000000..4424fac
--- /dev/null
@@ -0,0 +1,9 @@
+Gregorian - Monday-based week with week numbers
+     September 2006    
+   Mo Tu We Th Fr Sa Su
+35              1  2  3 
+36  4  5  6  7  8  9 10 
+37 11 12 13 14 15 16 17 
+38 18 19 20 21 22 23 24 
+39 25 26 27 28 29 30    
+                        
diff --git a/tests/expected/cal/month-1s b/tests/expected/cal/month-1s
new file mode 100644 (file)
index 0000000..e5e2e1a
--- /dev/null
@@ -0,0 +1,9 @@
+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 
+                     
diff --git a/tests/expected/cal/month-1sj b/tests/expected/cal/month-1sj
new file mode 100644 (file)
index 0000000..93bf73b
--- /dev/null
@@ -0,0 +1,9 @@
+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/expected/cal/month-1sjw b/tests/expected/cal/month-1sjw
new file mode 100644 (file)
index 0000000..ad9bc50
--- /dev/null
@@ -0,0 +1,9 @@
+Julian - Sunday-based week with week numbers
+        September 2006        
+   Sun Mon Tue Wed Thu Fri Sat
+35                     244 245 
+36 246 247 248 249 250 251 252 
+37 253 254 255 256 257 258 259 
+38 260 261 262 263 264 265 266 
+39 267 268 269 270 271 272 273 
+                               
diff --git a/tests/expected/cal/month-1sw b/tests/expected/cal/month-1sw
new file mode 100644 (file)
index 0000000..c7e676b
--- /dev/null
@@ -0,0 +1,9 @@
+Gregorian - Sunday-based week with week numbers
+     September 2006    
+   Su Mo Tu We Th Fr Sa
+35                 1  2 
+36  3  4  5  6  7  8  9 
+37 10 11 12 13 14 15 16 
+38 17 18 19 20 21 22 23 
+39 24 25 26 27 28 29 30 
+                        
diff --git a/tests/expected/cal/month-3m b/tests/expected/cal/month-3m
new file mode 100644 (file)
index 0000000..bbeb923
--- /dev/null
@@ -0,0 +1,9 @@
+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                
diff --git a/tests/expected/cal/month-3mj b/tests/expected/cal/month-3mj
new file mode 100644 (file)
index 0000000..73a7874
--- /dev/null
@@ -0,0 +1,9 @@
+Julian - Monday-based week
+       December 2017                 January 2018                February 2018       
+Mon Tue Wed Thu Fri Sat Sun  Mon Tue Wed Thu Fri Sat Sun  Mon Tue Wed Thu Fri Sat Sun
+                335 336 337    1   2   3   4   5   6   7               32  33  34  35 
+338 339 340 341 342 343 344    8   9  10  11  12  13  14   36  37  38  39  40  41  42 
+345 346 347 348 349 350 351   15  16  17  18  19  20  21   43  44  45  46  47  48  49 
+352 353 354 355 356 357 358   22  23  24  25  26  27  28   50  51  52  53  54  55  56 
+359 360 361 362 363 364 365   29  30  31                   57  58  59                 
+                                                                                      
diff --git a/tests/expected/cal/month-3mjw b/tests/expected/cal/month-3mjw
new file mode 100644 (file)
index 0000000..62e6eb8
--- /dev/null
@@ -0,0 +1,9 @@
+Julian - Monday-based week with week numbers
+          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
+31     213 214 215 216 217 218  35                 244 245 246  39                         274 
+32 219 220 221 222 223 224 225  36 247 248 249 250 251 252 253  40 275 276 277 278 279 280 281 
+33 226 227 228 229 230 231 232  37 254 255 256 257 258 259 260  41 282 283 284 285 286 287 288 
+34 233 234 235 236 237 238 239  38 261 262 263 264 265 266 267  42 289 290 291 292 293 294 295 
+35 240 241 242 243              39 268 269 270 271 272 273      43 296 297 298 299 300 301 302 
+                                                                44 303 304                     
diff --git a/tests/expected/cal/month-3mw b/tests/expected/cal/month-3mw
new file mode 100644 (file)
index 0000000..3074d67
--- /dev/null
@@ -0,0 +1,9 @@
+Gregorian - Monday-based week with week numbers
+      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
+31     1  2  3  4  5  6  35              1  2  3  39                    1 
+32  7  8  9 10 11 12 13  36  4  5  6  7  8  9 10  40  2  3  4  5  6  7  8 
+33 14 15 16 17 18 19 20  37 11 12 13 14 15 16 17  41  9 10 11 12 13 14 15 
+34 21 22 23 24 25 26 27  38 18 19 20 21 22 23 24  42 16 17 18 19 20 21 22 
+35 28 29 30 31           39 25 26 27 28 29 30     43 23 24 25 26 27 28 29 
+                                                  44 30 31                
diff --git a/tests/expected/cal/month-3s b/tests/expected/cal/month-3s
new file mode 100644 (file)
index 0000000..f65fb83
--- /dev/null
@@ -0,0 +1,9 @@
+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             
+                                                                 
diff --git a/tests/expected/cal/month-3sj b/tests/expected/cal/month-3sj
new file mode 100644 (file)
index 0000000..25ea578
--- /dev/null
@@ -0,0 +1,9 @@
+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/expected/cal/month-3sjw b/tests/expected/cal/month-3sjw
new file mode 100644 (file)
index 0000000..2c0aa92
--- /dev/null
@@ -0,0 +1,9 @@
+Julian - Sunday-based week with week numbers
+          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
+31         213 214 215 216 217  35                     244 245  40 274 275 276 277 278 279 280 
+32 218 219 220 221 222 223 224  36 246 247 248 249 250 251 252  41 281 282 283 284 285 286 287 
+33 225 226 227 228 229 230 231  37 253 254 255 256 257 258 259  42 288 289 290 291 292 293 294 
+34 232 233 234 235 236 237 238  38 260 261 262 263 264 265 266  43 295 296 297 298 299 300 301 
+35 239 240 241 242 243          39 267 268 269 270 271 272 273  44 302 303 304                 
+                                                                                               
diff --git a/tests/expected/cal/month-3sw b/tests/expected/cal/month-3sw
new file mode 100644 (file)
index 0000000..67fe4cb
--- /dev/null
@@ -0,0 +1,9 @@
+Gregorian - Sunday-based week with week numbers
+      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
+31        1  2  3  4  5  35                 1  2  40  1  2  3  4  5  6  7 
+32  6  7  8  9 10 11 12  36  3  4  5  6  7  8  9  41  8  9 10 11 12 13 14 
+33 13 14 15 16 17 18 19  37 10 11 12 13 14 15 16  42 15 16 17 18 19 20 21 
+34 20 21 22 23 24 25 26  38 17 18 19 20 21 22 23  43 22 23 24 25 26 27 28 
+35 27 28 29 30 31        39 24 25 26 27 28 29 30  44 29 30 31             
+                                                                          
diff --git a/tests/ts/cal/1m b/tests/ts/cal/1m
deleted file mode 100755 (executable)
index 9f691e1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# 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="${0%/*}/../.."
-TS_DESC="1 month"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-
-ts_check_test_command "$TS_CMD_CAL"
-
-export TERM=linux
-
-USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME="27 09 2006"
-
-[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
-ts_log ""
-
-ts_log "Gregorian - Monday-based week"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1m $MYTIME
-fi
-$TS_CMD_CAL -1m $MYTIME >> $TS_OUTPUT
-
-ts_log "Gregorian - Sunday-based week"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1s $MYTIME
-fi
-$TS_CMD_CAL -1s $MYTIME >> $TS_OUTPUT
-
-
-ts_log "Julian - Monday-based week"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1mj $MYTIME
-fi
-$TS_CMD_CAL -1mj $MYTIME >> $TS_OUTPUT
-
-ts_log "Julian - Sunday-based week"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1sj $MYTIME
-fi
-$TS_CMD_CAL -1sj $MYTIME >> $TS_OUTPUT
-
-ts_finalize
-
diff --git a/tests/ts/cal/1mw b/tests/ts/cal/1mw
deleted file mode 100755 (executable)
index 3234a6a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# 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="${0%/*}/../.."
-TS_DESC="1 month with week numbers"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-
-ts_check_test_command "$TS_CMD_CAL"
-
-export TERM=linux
-
-USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME="27 09 2006"
-
-[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
-ts_log ""
-
-ts_log "Gregorian - Monday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1mw $MYTIME
-fi
-$TS_CMD_CAL -1mw $MYTIME >> $TS_OUTPUT
-
-ts_log "Gregorian - Sunday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1sw $MYTIME
-fi
-$TS_CMD_CAL -1sw $MYTIME >> $TS_OUTPUT
-
-
-ts_log "Julian - Monday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1mjw $MYTIME
-fi
-$TS_CMD_CAL -1mjw $MYTIME >> $TS_OUTPUT
-
-ts_log "Julian - Sunday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -1sjw $MYTIME
-fi
-$TS_CMD_CAL -1sjw $MYTIME >> $TS_OUTPUT
-
-ts_finalize
-
diff --git a/tests/ts/cal/3m b/tests/ts/cal/3m
deleted file mode 100755 (executable)
index baa9ba3..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# 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="${0%/*}/../.."
-TS_DESC="3 months"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-
-ts_check_test_command "$TS_CMD_CAL"
-
-export TERM=linux
-
-USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME="27 09 2006"
-
-[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
-ts_log ""
-
-ts_log "Gregorian - Monday-based week"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3m $MYTIME
-fi
-$TS_CMD_CAL -3m $MYTIME >> $TS_OUTPUT
-
-ts_log "Gregorian - Sunday-based week"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3s $MYTIME
-fi
-$TS_CMD_CAL -3s $MYTIME >> $TS_OUTPUT
-
-
-ts_log "Julian - Monday-based week"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -3mj $MYTIME
-fi
-$TS_CMD_CAL -3mj $MYTIME >> $TS_OUTPUT
-
-ts_log "Julian - Sunday-based week"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3sj $MYTIME
-fi
-$TS_CMD_CAL -3sj $MYTIME >> $TS_OUTPUT
-
-ts_finalize
-
diff --git a/tests/ts/cal/3mw b/tests/ts/cal/3mw
deleted file mode 100755 (executable)
index cb3905b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# 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="${0%/*}/../.."
-TS_DESC="3 months with week numbers"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-
-ts_check_test_command "$TS_CMD_CAL"
-
-USETERM=$( ts_has_option "useterm" "$*" )
-MYTIME="27 09 2006"
-
-[ "$USETERM" == "yes" ] && TS_VERBOSE="yes"
-ts_log ""
-
-ts_log "Gregorian - Monday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3mw $MYTIME
-fi
-$TS_CMD_CAL -3mw $MYTIME >> $TS_OUTPUT
-
-ts_log "Gregorian - Sunday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3sw $MYTIME
-fi
-$TS_CMD_CAL -3sw $MYTIME >> $TS_OUTPUT
-
-
-ts_log "Julian - Monday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-       $TS_CMD_CAL -3mjw $MYTIME
-fi
-$TS_CMD_CAL -3mjw $MYTIME >> $TS_OUTPUT
-
-ts_log "Julian - Sunday-based week with week numbers"
-if [ "$USETERM" == "yes" ]; then
-        $TS_CMD_CAL -3sjw $MYTIME
-fi
-$TS_CMD_CAL -3sjw $MYTIME >> $TS_OUTPUT
-
-ts_finalize
-
diff --git a/tests/ts/cal/month b/tests/ts/cal/month
new file mode 100755 (executable)
index 0000000..ba4e07a
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2007-2018 Karel Zak <kzak@redhat.com>
+#
+# 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="${0%/*}/../.."
+TS_DESC="month"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_CAL"
+
+export TERM=linux
+
+USETERM=$( ts_has_option "useterm" "$*" )
+MYTIME="27 09 2006"
+
+function call_cal {
+       local testname=$(echo "$2" | sed 's/-//g')
+
+       ts_init_subtest "$testname"
+       ts_log "$1"
+       shift
+       if [ "$USETERM" == "yes" ]; then
+               $TS_CMD_CAL "$@"
+       fi
+       $TS_CMD_CAL "$@" >> $TS_OUTPUT
+
+       ts_finalize_subtest
+}
+
+call_cal "Gregorian - Monday-based week" -1m $MYTIME
+call_cal "Gregorian - Sunday-based week" -1s $MYTIME
+call_cal "Julian - Monday-based week" -1mj $MYTIME
+call_cal "Julian - Sunday-based week" -1sj $MYTIME
+call_cal "Gregorian - Monday-based week with week numbers" -1mw $MYTIME
+call_cal "Gregorian - Sunday-based week with week numbers" -1sw $MYTIME
+call_cal "Julian - Monday-based week with week numbers" -1mjw $MYTIME
+call_cal "Julian - Sunday-based week with week numbers" -1sjw $MYTIME
+call_cal "Gregorian - Monday-based week" -3m $MYTIME
+call_cal "Gregorian - Sunday-based week" -3s $MYTIME
+call_cal "Julian - Monday-based week" -3mj $MYTIMET
+call_cal "Julian - Sunday-based week" -3sj $MYTIME
+call_cal "Gregorian - Monday-based week with week numbers" -3mw $MYTIME
+call_cal "Gregorian - Sunday-based week with week numbers" -3sw $MYTIME
+call_cal "Julian - Monday-based week with week numbers" -3mjw $MYTIME
+call_cal "Julian - Sunday-based week with week numbers" -3sjw $MYTIME
+
+ts_finalize
+