Index: tests/natools-s_expressions-cache_tests.adb ================================================================== --- tests/natools-s_expressions-cache_tests.adb +++ tests/natools-s_expressions-cache_tests.adb @@ -72,10 +72,11 @@ procedure All_Tests (Report : in out NT.Reporter'Class) is begin Default_Instantiation (Report); Debug_Instantiation (Report); + Descriptor_Interface (Report); end All_Tests; ----------------------- -- Inidividual Tests -- @@ -226,6 +227,55 @@ end; exception when Error : others => Test.Report_Exception (Error); end Default_Instantiation; + + procedure Descriptor_Interface (Report : in out NT.Reporter'Class) is + Test : NT.Test := Report.Item ("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; + Second := First; + + Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0); + Test_Tools.Test_Atom_Accessors (Test, Second, 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); + Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2); + Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 1); + Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2); + Test_Tools.Next_And_Check (Test, Second, To_Atom ("command"), 1); + 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 Descriptor_Interface; + end Natools.S_Expressions.Cache_Tests; Index: tests/natools-s_expressions-cache_tests.ads ================================================================== --- tests/natools-s_expressions-cache_tests.ads +++ tests/natools-s_expressions-cache_tests.ads @@ -28,7 +28,8 @@ procedure All_Tests (Report : in out NT.Reporter'Class); procedure Debug_Instantiation (Report : in out NT.Reporter'Class); procedure Default_Instantiation (Report : in out NT.Reporter'Class); + procedure Descriptor_Interface (Report : in out NT.Reporter'Class); end Natools.S_Expressions.Cache_Tests;