are_1.4.0_a458cb9e/regtests/files/test-ada-1/src/test1.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
with Resources1;
with Ada.Command_Line;
with Ada.Text_IO;
procedure Test1 is
   use Resources1;

   C : Content_Access := Get_Content ("main.html");
begin
   if C = null then
      Ada.Text_IO.Put_Line ("FAIL: No content 'main.html'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
      return;
   end if;
   if C'Length /= 356 then
      Ada.Text_IO.Put_Line ("FAIL: Invalid length for 'main.html'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
   end if;

   C := Get_Content ("js/main.js");
   if C = null then
      Ada.Text_IO.Put_Line ("FAIL: No content 'js/main.js'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
      return;
   end if;
   if C'Length /= 87 then
      Ada.Text_IO.Put_Line ("FAIL: Invalid length for 'js/main.js'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
   end if;

   C := Get_Content ("css/main.css");
   if C = null then
      Ada.Text_IO.Put_Line ("FAIL: No content 'css/main.css'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
      return;
   end if;
   if C'Length /= 60 then
      Ada.Text_IO.Put_Line ("FAIL: Invalid length for 'css/main.css'");
      Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
   end if;

   Ada.Text_IO.Put ("PASS: ");
   for Val of C.all loop
      if Character'Val (Val) /= ASCII.LF then
         Ada.Text_IO.Put (Character'Val (Val));
      end if;
   end loop;
   Ada.Text_IO.New_Line;
end Test1;