Natools

Diff
Login

Differences From Artifact [6dbc93453b]:

To Artifact [1b97a3201a]:


64
65
66
67
68
69
70

71
72
73
74
75
76
77
   begin
      Composite_Components (Report);
      Forced_Time_Zone (Report);
      Padded_Components (Report);
      RFC_3339 (Report);
      Simple_Components (Report);
      Static_Hash_Map (Report);

   end All_Tests;


   -----------------------
   -- Inidividual Tests --
   -----------------------








>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
   begin
      Composite_Components (Report);
      Forced_Time_Zone (Report);
      Padded_Components (Report);
      RFC_3339 (Report);
      Simple_Components (Report);
      Static_Hash_Map (Report);
      Weekday_In_Time_Zone (Report);
   end All_Tests;


   -----------------------
   -- Inidividual Tests --
   -----------------------

242
243
244
245
246
247
248

































249
      if not Natools.Static_Maps.S_Expressions.Templates.Dates.T then
         Test.Fail;
      end if;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Static_Hash_Map;


































end Natools.S_Expressions.Templates.Tests.Dates;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

243
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
274
275
276
277
278
279
280
281
282
283
      if not Natools.Static_Maps.S_Expressions.Templates.Dates.T then
         Test.Fail;
      end if;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Static_Hash_Map;


   procedure Weekday_In_Time_Zone (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Week day in various time zones");
      Early : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
        (2015, 11, 11, 0, 29, 0, Time_Zone => 0);
      Late : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of
        (2015, 11, 11, 23, 31, 0, Time_Zone => 0);
      Template_Prefix : constant String := "(in-zone ";
      Template_Suffix : constant String
        := " (day-of-week Monday Tuesday Wednesday"
         & " Thursday Friday Saturday Sunday) 1: "
         & " (day (suffix th (st 1 21 31) (nd 2 22) (rd 3 23))) 2:, "
         & " (hour) 1:: (padded-minute))";

      procedure Double_Test (Zone, Expected_Early, Expected_Late : String);

      procedure Double_Test (Zone, Expected_Early, Expected_Late : String) is
      begin
         Test_Render
           (Test, Template_Prefix & Zone & Template_Suffix,
            Expected_Early, Early);
         Test_Render
           (Test, Template_Prefix & Zone & Template_Suffix,
            Expected_Late, Late);
      end Double_Test;
   begin
      Double_Test ("0", "Wednesday 11th, 0:29", "Wednesday 11th, 23:31");
      Double_Test ("-01:00", "Tuesday 10th, 23:29", "Wednesday 11th, 22:31");
      Double_Test ("+01:00", "Wednesday 11th, 1:29", "Thursday 12th, 0:31");
   exception
      when Error : others => Test.Report_Exception (Error);
   end Weekday_In_Time_Zone;

end Natools.S_Expressions.Templates.Tests.Dates;