@@ -82,7 +82,11 @@ function Test return Integer is
8282
8383 Int_0 : JSON_Value := Create (Integer'(0 ));
8484 Int_1 : constant JSON_Value := Create (Integer'(1 ));
85+ Int_2 : constant JSON_Value := Create (Integer'(2 ));
86+ Int_3 : constant JSON_Value := Create (Integer'(3 ));
87+
8588 Hello_World : constant JSON_Value := Create (" Hello world!" );
89+ Hi_World : constant JSON_Value := Create (" Hi world!" );
8690
8791 Float_0 : constant JSON_Value := Create (Float'(0.0 ));
8892 Float_1 : constant JSON_Value := Create (Float'(1.0 ));
99103
100104 declare
101105 Arr : JSON_Array := Int_0 & Int_1 & Hello_World;
106+ Arr2 : constant JSON_Array := Int_2 & Int_3 & Hi_World;
102107 Empty : constant JSON_Array := Empty_Array;
103108 begin
104109 -- Inspect an empty array
@@ -143,6 +148,26 @@ begin
143148 Clear (Arr);
144149 A.Assert (Length (Arr) = 0 );
145150
151+ Arr := Hello_World & Int_0 & Int_1;
152+ Append (Arr, Arr2);
153+ A.Assert (Length (Arr) = 6 );
154+ A.Assert (Get (Arr, 1 ) = Hello_World);
155+ A.Assert (Get (Arr, 2 ) = Int_0);
156+ A.Assert (Get (Arr, 3 ) = Int_1);
157+ A.Assert (Get (Arr, 4 ) = Int_2);
158+ A.Assert (Get (Arr, 5 ) = Int_3);
159+ A.Assert (Get (Arr, 6 ) = Hi_World);
160+
161+ Arr := Hello_World & Int_0 & Int_1;
162+ Prepend (Arr, Arr2);
163+ A.Assert (Length (Arr) = 6 );
164+ A.Assert (Get (Arr, 1 ) = Int_2);
165+ A.Assert (Get (Arr, 2 ) = Int_3);
166+ A.Assert (Get (Arr, 3 ) = Hi_World);
167+ A.Assert (Get (Arr, 4 ) = Hello_World);
168+ A.Assert (Get (Arr, 5 ) = Int_0);
169+ A.Assert (Get (Arr, 6 ) = Int_1);
170+
146171 Arr := Hello_World & Int_0 & Int_1 & Int_0;
147172 Sort (Arr, Less'Access );
148173 Check_Image (Create (Arr), " [0,0,1,"" Hello world!"" ]" );
0 commit comments