Natools

Diff
Login

Differences From Artifact [a30546dd04]:

To Artifact [79759db515]:


109
110
111
112
113
114
115

116
117
118
119
120
121
122
   procedure All_Tests (Report : in out NT.Reporter'Class) is
   begin
      Basic_Printing (Report);
      Atom_Encodings (Report);
      Separators (Report);
      Atom_Width (Report);
      Quoted_String_Escapes (Report);

   end All_Tests;



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







>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
   procedure All_Tests (Report : in out NT.Reporter'Class) is
   begin
      Basic_Printing (Report);
      Atom_Encodings (Report);
      Separators (Report);
      Atom_Width (Report);
      Quoted_String_Escapes (Report);
      Indentation (Report);
   end All_Tests;



   -----------------------
   -- Inidividual Tests --
   -----------------------
237
238
239
240
241
242
243





















































244
245
246
247
248
249
250

         Check_Stream (Test, Output);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Basic_Printing;























































   procedure Quoted_String_Escapes (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Escapes in quoted string atoms");
      Source : constant Atom (0 .. 123) := To_Atom
        ("Special: "  --  indices 0 .. 17
         & Latin_1.BS & Latin_1.HT & Latin_1.LF
         & Latin_1.VT & Latin_1.FF & Latin_1.CR







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







238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304

         Check_Stream (Test, Output);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Basic_Printing;


   procedure Indentation (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Indentation");
      Param : Parameters
        := (Width => 16,
            Newline_At => (others => (others => False)),
            Space_At => (others => (others => False)),
            Tab_Stop => 8,
            Indentation => 3,
            Indent => Tabs_And_Spaces,
            Quoted => Single_Line,
            Token => Standard_Token,
            Hex_Casing => Encodings.Upper,
            Quoted_Escape => Hex_Escape,
            Char_Encoding => ASCII,
            Fallback => Verbatim,
            Newline => LF);
   begin
      Parse_Print_Test (Test, Param, To_Atom
        ("(first-level(" & Latin_1.LF
         & "      second-level" & Latin_1.LF
         & "      (third" & Latin_1.LF
         & Latin_1.HT & " level" & Latin_1.LF
         & Latin_1.HT & " ""Q#""))" & Latin_1.LF
         & "   end)"));

      Param.Indent := Spaces;
      Param.Token := Extended_Token;

      Parse_Print_Test (Test, Param, To_Atom
        ("(first-level(" & Latin_1.LF
         & "      second-level" & Latin_1.LF
         & "      (third" & Latin_1.LF
         & "         level" & Latin_1.LF
         & "         ""Q)""))" & Latin_1.LF
         & "   end)"));

      Param.Indent := Tabs;
      Param.Indentation := 1;
      Param.Tab_Stop := 5;

      Parse_Print_Test (Test, Param, To_Atom
        ("(first-level(" & Latin_1.LF
         & Latin_1.HT & Latin_1.HT & "second-level" & Latin_1.LF
         & Latin_1.HT & Latin_1.HT & "(third" & Latin_1.LF
         & Latin_1.HT & Latin_1.HT & Latin_1.HT & "level" & Latin_1.LF
         & Latin_1.HT & Latin_1.HT & Latin_1.HT & "2:Q(" & Latin_1.LF
         & Latin_1.HT & Latin_1.HT & "))end)"));

   exception
      when Error : others => Test.Report_Exception (Error);
   end Indentation;


   procedure Quoted_String_Escapes (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Escapes in quoted string atoms");
      Source : constant Atom (0 .. 123) := To_Atom
        ("Special: "  --  indices 0 .. 17
         & Latin_1.BS & Latin_1.HT & Latin_1.LF
         & Latin_1.VT & Latin_1.FF & Latin_1.CR