| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use warningsscip-perl cpan Date-Manip 6.99 warnings/; |
| 4 | use strictscip-perl cpan Date-Manip 6.99 strict/; |
| 5 | use Test::Interscip-perl cpan Date-Manip 6.99 Test/Inter/; |
| 6 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`. = new Test::Inter $0scip-perl cpan Date-Manip 6.99 main/$0.; |
| 7 | requirescip-perl cpan Date-Manip 6.99 main/require(). "tests.pl"; |
| 8 | |
| 9 | our $dmtscip-perl cpan Date-Manip 6.99 main/$dmt. = new Date::Manip::TZ; |
| 10 | our $objscip-perl cpan Date-Manip 6.99 main/$obj. = $dmtscip-perl cpan Date-Manip 6.99 main/$dmt.->basescip-perl cpan Date-Manip 6.99 main/base().(); |
| 11 | $dmtscip-perl cpan Date-Manip 6.99 main/$dmt.->configscip-perl cpan Date-Manip 6.99 main/config().("forcedate","now,America/New_York"); |
| 12 | $objscip-perl cpan Date-Manip 6.99 main/$obj.->_methodscip-perl cpan Date-Manip 6.99 main/_method().("50"); |
| 13 | |
| 14 | sub testscip-perl cpan Date-Manip 6.99 main/test(). { |
| 15 | my(@test)=@_scip-perl cpan Date-Manip 6.99 main/`@_`.; |
| 16 | my @ret = $objscip-perl cpan Date-Manip 6.99 main/$obj.->_fix_yearscip-perl cpan Date-Manip 6.99 main/_fix_year().(@test); |
| 17 | return @ret; |
| 18 | } |
| 19 | |
| 20 | sub _yscip-perl cpan Date-Manip 6.99 main/_y(). { |
| 21 | my($yyyy) = @_scip-perl cpan Date-Manip 6.99 main/`@_`.; |
| 22 | $yyyy =~ /^..(..)/; |
| 23 | my $yy = $1scip-perl cpan Date-Manip 6.99 main/$1.; |
| 24 | return($yyyy,$yy); |
| 25 | } |
| 26 | |
| 27 | my $y = ( localtimescip-perl cpan Date-Manip 6.99 main/localtime().(timescip-perl cpan Date-Manip 6.99 main/time().) )[5]; |
| 28 | $y += 1900; |
| 29 | |
| 30 | my($yyyy,$yy) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y); |
| 31 | |
| 32 | my($yyyyM05,$yyM05) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y-5); |
| 33 | my($yyyyP05,$yyP05) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y+5); |
| 34 | |
| 35 | my($yyyyM49,$yyM49) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y-49); |
| 36 | my($yyyyM50,$yyM50) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y-50); |
| 37 | my($yyyyM51,$yyM51) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y-51); $yyyyM51 += 100; |
| 38 | |
| 39 | my($yyyyP48,$yyP48) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y+48); |
| 40 | my($yyyyP49,$yyP49) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y+49); |
| 41 | my($yyyyP50,$yyP50) = _yscip-perl cpan Date-Manip 6.99 main/_y().($y+50); $yyyyP50 -= 100; |
| 42 | |
| 43 | my $tests=" |
| 44 | |
| 45 | $yy => $yyyy |
| 46 | |
| 47 | $yyM05 => $yyyyM05 |
| 48 | |
| 49 | $yyP05 => $yyyyP05 |
| 50 | |
| 51 | $yyM49 => $yyyyM49 |
| 52 | |
| 53 | $yyM50 => $yyyyM50 |
| 54 | |
| 55 | $yyM51 => $yyyyM51 |
| 56 | |
| 57 | $yyP48 => $yyyyP48 |
| 58 | |
| 59 | $yyP49 => $yyyyP49 |
| 60 | |
| 61 | $yyP50 => $yyyyP50 |
| 62 | |
| 63 | "; |
| 64 | |
| 65 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`.->testsscip-perl cpan Date-Manip 6.99 main/tests().(func => \&testscip-perl cpan Date-Manip 6.99 main/test()., |
| 66 | tests => $tests); |
| 67 | $::tiscip-perl cpan Date-Manip 6.99 main/`$::ti`.->done_testingscip-perl cpan Date-Manip 6.99 main/done_testing().(); |
| 68 | |
| 69 | #Local Variables: |
| 70 | #mode: cperl |
| 71 | #indent-tabs-mode: nil |
| 72 | #cperl-indent-level: 3 |
| 73 | #cperl-continued-statement-offset: 2 |
| 74 | #cperl-continued-brace-offset: 0 |
| 75 | #cperl-brace-offset: 0 |
| 76 | #cperl-brace-imaginary-offset: 0 |
| 77 | #cperl-label-offset: 0 |
| 78 | #End: |