Natools

Diff
Login

Differences From Artifact [47eb5e3287]:

To Artifact [8372577f83]:


74
75
76
77
78
79
80

81
82
83
84
85
86
87
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88







+








   procedure All_Tests (Report : in out NT.Reporter'Class) is
   begin
      Default_Instantiation (Report);
      Debug_Instantiation (Report);
      Descriptor_Interface (Report);
      Lockable_Interface (Report);
      Replayable_Interface (Report);
   end All_Tests;


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

332
333
334
335
336
337
338














































339
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

            Lockable.Tests.Test_Interface (Test, Cursor);
         end;
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Lockable_Interface;


   procedure Replayable_Interface (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Replayable.Descriptor insterface");
   begin
      declare
         Cache : Caches.Reference;
         First, Second : Caches.Cursor;
      begin
         Cache.Append_Atom (To_Atom ("begin"));
         Cache.Open_List;
         Cache.Append_Atom (To_Atom ("command"));
         Cache.Open_List;
         Cache.Append_Atom (To_Atom ("first"));
         Cache.Append_Atom (To_Atom ("second"));
         Cache.Close_List;
         Cache.Close_List;
         Cache.Append_Atom (To_Atom ("end"));

         First := Cache.First;

         Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);

         Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
         Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
         Second := First.Duplicate;
         Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
         Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
         Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
         Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
         Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
         Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
         Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
         Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
         Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Replayable_Interface;

end Natools.S_Expressions.Cache_Tests;