Natools

Diff
Login

Differences From Artifact [8372577f83]:

To Artifact [a1517afdd4]:


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 --
   -----------------------








>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
   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);
      Duplication (Report);
   end All_Tests;


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

307
308
309
310
311
312
313



























































314
315
316
317
318
319
320
         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 Descriptor_Interface;





























































   procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
   begin
      declare
         Cache : Caches.Reference;
      begin







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







308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
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
         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 Descriptor_Interface;


   procedure Duplication (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Duplication of general descriptor");
   begin
      Full_Duplication :
      declare
         Input : aliased Test_Tools.Memory_Stream;
         Parser : Parsers.Stream_Parser (Input'Access);
      begin
         Input.Set_Data (Lockable.Tests.Test_Expression);
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);

         declare
            Image : Caches.Cursor := Caches.Move (Parser);
         begin
            Lockable.Tests.Test_Interface (Test, Image);
         end;
      end Full_Duplication;

      Partial_Duplication :
      declare
         Input : aliased Test_Tools.Memory_Stream;
         Parser : Parsers.Stream_Parser (Input'Access);
         Copy : Caches.Cursor;
      begin
         Input.Set_Data (To_Atom
           ("(first_part (command-1) (command-2 arg-1 arg-2) end)"
            & "(second_part (command-3 arg-3) final)"));
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("first_part"), 1);

         Copy := Caches.Move (Parser);

         Test_Tools.Test_Atom_Accessors
           (Test, Copy, To_Atom ("first_part"), 0);
         Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
         Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-1"), 1);
         Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
         Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-2"), 1);
         Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-1"), 1);
         Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-2"), 1);
         Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Copy, To_Atom ("end"), 0);
         Test_Tools.Next_And_Check (Test, Copy, Events.End_Of_Input, 0);

         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("second_part"), 1);
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("command-3"), 2);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg-3"), 2);
         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 1);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("final"), 1);
         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
      end Partial_Duplication;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Duplication;


   procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
   begin
      declare
         Cache : Caches.Reference;
      begin