97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(Test, "(SSMMHH)(DDMMYYYY)",
"01082129012014",
Ada.Calendar.Formatting.Time_Of (2014, 1, 29, 21, 8, 1));
exception
when Error : others => Test.Report_Exception (Error);
end Composite_Components;
procedure Forced_Time_Zone (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Time zone set in template");
Moment : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
(2012, 8, 29, 22, 42, 16, Time_Zone => 0);
begin
Test_Render
(Test, "(in-zone 0 (rfc-3339))",
"2012-08-29T22:42:16Z", Moment);
Test_Render
(Test, "(in-zone CEST (rfc-3339))",
"2012-08-30T00:42:16+02:00", Moment);
Test_Render
(Test, "(in-zone -01:12 (rfc-3339))",
"2012-08-29T21:30:16-01:12", Moment);
Test_Render
(Test, "(in-zone +0130 (rfc-3339))",
"2012-08-30T00:12:16+01:30", Moment);
Test_Render
(Test, "(in-zone -10 (rfc-3339))",
"2012-08-29T12:42:16-10:00", Moment);
Test_Render
(Test, "(in-zone FOO (rfc-3339))",
"", Moment);
Test_Render
(Test, "(in-zone BARST (rfc-3339))",
"", Moment);
Test_Render
(Test, "(in-zone 12345 (rfc-3339))",
"", Moment);
exception
when Error : others => Test.Report_Exception (Error);
end Forced_Time_Zone;
procedure Padded_Components (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Simple time components with padding");
Template : constant String
:= "(padded-month)(padded-day)(padded-hour)(minute)(padded-second)";
begin
Test_Render
|