104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
+
|
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Test_Conversions (Report);
Test_Exceptions (Report);
Test_Interval_Arithmetic (Report);
Test_Navigation (Report);
Test_Reductions (Report);
Test_Slices (Report);
Test_Tokenization (Report);
end All_Tests;
----------------------
|
777
778
779
780
781
782
783
784
785
786
787
788
789
790
|
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
if not Reported then
Report.Item (Name, NT.Success);
end if;
exception
when Error : others => Report.Report_Exception (Name, Error);
end Test_Interval_Arithmetic;
procedure Test_Reductions (Report : in out NT.Reporter'Class) is
Name : constant String := "Slice set reductions";
Reported : Boolean := False;
begin
declare
use type Slice_Sets.Slice_Set;
Set : Slice_Sets.Slice_Set := Slice_Sets.To_Slice_Set (Parent_String);
Subset : Slice_Sets.Slice_Set;
First : constant Positive := 21;
Last : constant Positive := 50;
Middle_First : constant Positive := 30;
Middle_Last : constant Positive := 39;
Expected_String : constant String
:= Parent_String (First .. Middle_First - 1)
& Parent_String (Middle_Last + 1 .. Last);
begin
Set.Exclude_Slice (Middle_First, Middle_Last);
Set.Restrict (First, Last);
if Set.To_String /= Expected_String then
Info_Fail (Report, Name, Reported,
"Expected """ & Expected_String & '"');
Dump (Report, Set);
end if;
Set.Restrict (First, First - 1);
if Set.Is_Null or not Set.Is_Empty then
Info_Fail (Report, Name, Reported, "Expected empty set");
Dump (Report, Set);
end if;
Subset := Set.Subset (Parent_String'First, Parent_String'Last);
if Subset.Is_Null or not Set.Is_Empty then
Info_Fail (Report, Name, Reported, "Expected empty subset");
Dump (Report, Subset);
end if;
Set.Add_Slice (First, Last);
Set.Exclude_Slice (Middle_First, Middle_Last);
Subset := Set.Subset (Parent_String'First, Last);
if Subset /= Set then
Info_Fail (Report, Name, Reported, "Expected equal subset");
Dump (Report, Set);
Dump (Report, Subset);
end if;
Subset := Set.Subset (First + 1, Middle_First - 2);
if Subset.To_String
/= Parent_String (First + 1 .. Middle_First - 2)
then
Info_Fail (Report, Name, Reported, "Expected """
& Parent_String (First + 1 .. Middle_First - 2) & '"');
Dump (Report, Subset);
end if;
end;
if not Reported then
Report.Item (Name, NT.Success);
end if;
exception
when Error : others => Report.Report_Exception (Name, Error);
end Test_Reductions;
procedure Test_Navigation (Report : in out NT.Reporter'Class) is
Name : constant String := "External index navigation";
begin
declare
Set : Slice_Sets.Slice_Set := Slice_Sets.To_Slice_Set (Parent_String);
Middle_First : constant Positive := 20;
|