File: f012.t

package info (click to toggle)
libdate-calc-xs-perl 6.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 812 kB
  • sloc: perl: 7,397; ansic: 2,607; makefile: 2
file content (102 lines) | stat: -rw-r--r-- 4,624 bytes parent folder | download | duplicates (6)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!perl -w

BEGIN { eval { require bytes; }; }
use strict;
no strict "vars";

use Date::Calc qw( Date_to_Text_Long Language Decode_Language );

# ======================================================================
#   $datestr = Date_to_Text_Long($year,$mm,$dd);
# ======================================================================

print "1..35\n";

$n = 1;
if (Date_to_Text_Long(1964,1,3) eq "Friday, January 3rd 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18) eq "Saturday, November 18th 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31) eq "Friday, December 31st 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1) eq "Saturday, January 1st 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2) eq "Sunday, January 2nd 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;

Language(Decode_Language("DE"));

if (Date_to_Text_Long(1964,1,3) eq "Freitag, den 3. Januar 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18) eq "Samstag, den 18. November 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31) eq "Freitag, den 31. Dezember 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1) eq "Samstag, den 1. Januar 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2) eq "Sonntag, den 2. Januar 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;

Language(Decode_Language("FR"));

if (Date_to_Text_Long(1964,1,3) eq "Vendredi 3 janvier 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18) eq "Samedi 18 novembre 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31) eq "Vendredi 31 dcembre 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1) eq "Samedi 1 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2) eq "Dimanche 2 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;


if (Date_to_Text_Long(1964,1,3,0) eq "Vendredi 3 janvier 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18,0) eq "Samedi 18 novembre 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31,0) eq "Vendredi 31 dcembre 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1,0) eq "Samedi 1 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2,0) eq "Dimanche 2 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;


if (Date_to_Text_Long(1964,1,3,1) eq "Friday, January 3rd 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18,1) eq "Saturday, November 18th 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31,1) eq "Friday, December 31st 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1,1) eq "Saturday, January 1st 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2,1) eq "Sunday, January 2nd 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;


if (Date_to_Text_Long(1964,1,3,2) eq "Vendredi 3 janvier 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18,2) eq "Samedi 18 novembre 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31,2) eq "Vendredi 31 dcembre 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1,2) eq "Samedi 1 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2,2) eq "Dimanche 2 janvier 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;


if (Date_to_Text_Long(1964,1,3,3) eq "Freitag, den 3. Januar 1964") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1995,11,18,3) eq "Samstag, den 18. November 1995") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(1999,12,31,3) eq "Freitag, den 31. Dezember 1999") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,1,3) eq "Samstag, den 1. Januar 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;
if (Date_to_Text_Long(2000,1,2,3) eq "Sonntag, den 2. Januar 2000") {print "ok $n\n";} else {print "not ok $n\n";}
$n++;

__END__