File: date_date_0.t

package info (click to toggle)
datemanip 5.33-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 480 kB
  • ctags: 87
  • sloc: perl: 6,461; makefile: 40; sh: 3
file content (70 lines) | stat: -rwxr-xr-x 1,132 bytes parent folder | download | duplicates (5)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/local/bin/perl -w

require 5.001;
use Date::Manip;
@Date::Manip::TestArgs=();
$runtests=shift(@ARGV);
if ( -f "t/test.pl" ) {
  require "t/test.pl";
} elsif ( -f "test.pl" ) {
  require "test.pl";
} else {
  die "ERROR: cannot find test.pl\n";
}
$ntest=11;

print "1..$ntest\n"  if (! $runtests);
&Date_Init(@Date::Manip::TestArgs);

$calcs="

Jan 1 1996 12:00:00
Jan 1 1996 14:30:30
  +0:0:0:0:2:30:30

Jan 1 1996 14:30:30
Jan 1 1996 12:00:00
  -0:0:0:0:2:30:30

Jan 1 1996 12:00:00
Jan 2 1996 14:30:30
  +0:0:0:1:2:30:30

Jan 2 1996 14:30:30
Jan 1 1996 12:00:00
  -0:0:0:1:2:30:30

Jan 1 1996 12:00:00
Jan 2 1996 10:30:30
  +0:0:0:0:22:30:30

Jan 2 1996 10:30:30
Jan 1 1996 12:00:00
  -0:0:0:0:22:30:30

Jan 1 1996 12:00:00
Jan 2 1997 10:30:30
  +0:0:52:2:22:30:30

Jan 2 1997 10:30:30
Jan 1 1996 12:00:00
  -0:0:52:2:22:30:30

Jan 1st 1997 00:00:01
Feb 1st 1997 00:00:00
  +0:0:4:2:23:59:59

Jan 1st 1997 00:00:01
Mar 1st 1997 00:00:00
  +0:0:8:2:23:59:59

Jan 1st 1997 00:00:01
Mar 1st 1998 00:00:00
  +0:0:60:3:23:59:59

";

print "DateCalc (date,date,exact)...\n";
&test_Func($ntest,\&DateCalc,$calcs,$runtests,0);

1;