Natools

Diff
Login

Differences From Artifact [d7b21f3cbc]:

To Artifact [14fd8e4476]:


1
2

3
4
5
6
7
8
9
1

2
3
4
5
6
7
8
9

-
+







------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté                                        --
-- Copyright (c) 2014-2017, Natacha Porté                                   --
--                                                                          --
-- Permission to use, copy, modify, and distribute this software for any    --
-- purpose with or without fee is hereby granted, provided that the above   --
-- copyright notice and this permission notice appear in all copies.        --
--                                                                          --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF         --
65
66
67
68
69
70
71

72
73
74
75
76
77
78
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79







+







      Special_Subexpression (Report);
      Nested_Subpexression (Report);
      Number_Prefixes (Report);
      Quoted_Escapes (Report);
      Lockable_Interface (Report);
      Reset (Report);
      Locked_Next (Report);
      Memory_Parser (Report);
   end All_Tests;



   -----------------------
   -- Inidividual Tests --
   -----------------------
162
163
164
165
166
167
168



























169
170
171
172
173
174
175
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Parser, Null_Atom, 0);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Locked_Next;


   procedure Memory_Parser (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Memory-backed parser");
   begin
      declare
         Parser : Parsers.Memory_Parser
           := Create_From_String ("(command (subcommand arg (arg list)))0:");
      begin
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("command"), 1);
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 2);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("subcommand"), 2);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg"), 2);
         Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 3);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg"), 3);
         Test_Tools.Next_And_Check (Test, Parser, To_Atom ("list"), 3);
         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 2);
         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 1);
         Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
         Test_Tools.Next_And_Check (Test, Parser, Null_Atom, 0);
         Test_Tools.Next_And_Check (Test, Parser, Events.End_Of_Input, 0);
         Test_Tools.Next_And_Check (Test, Parser, Events.End_Of_Input, 0);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Memory_Parser;


   procedure Nested_Subpexression (Report : in out NT.Reporter'Class) is
      procedure Test is new Blackbox_Test
        (Name => "Nested base-64 subepxressions",
         Source => To_Atom ("(5:begin"
           & "{KG5lc3RlZCB7S0dSbFpYQWdjR0Y1Ykc5aFpDaz19KQ==}"
           & "end)"),