Natools

Check-in [17fe0bb70a]
Login
Overview
Comment:s_expressions-interpreter_tests: use building functions in a test, to reach full coverage
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 17fe0bb70ab4ff25e7b03b6aad3cffd420583765
User & Date: nat on 2014-05-17 14:09:34
Other Links: manifest | tags
Context
2014-05-18
20:20
static_hash_maps: new code generation package to build static hash maps

A static hash map means here a hash maps completely known before compile time. It uses GNAT.Perfect_Hash_Generator to turn string keys into indexes for an array of elements. check-in: 582f564b61 user: nat tags: trunk

2014-05-17
14:09
s_expressions-interpreter_tests: use building functions in a test, to reach full coverage check-in: 17fe0bb70a user: nat tags: trunk
2014-05-16
17:48
s_expressions-interpreters: add constructor functions to make possible library-level constants check-in: bbcfe6dddf user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-interpreter_tests.adb from [30df107f0e] to [19cee4a167].

299
300
301
302
303
304
305
306




307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
   end Test_Local_Fallback;


   procedure Test_Premanent_Fallback (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Permanent fallback");
   begin
      declare
         Inter : Test_Interpreters.Interpreter := Test_Interpreter;




         Buffer : aliased Test_Tools.Memory_Stream;
         Printer : Printers.Canonical (Buffer'Access);
         Input : constant Caches.Reference := Invalid_Commands;
         Cursor : Caches.Cursor := Input.First;
      begin
         Buffer.Set_Expected (To_Atom
           ("7:not-cmd(14:7:not-cmd3:arg)13:not-a-command"
            & "(18:13:not-a-command())"));

         Inter.Set_Fallback (To_Atom ("cmd"));
         Inter.Execute (Cursor, Printer, True);

         Buffer.Check_Stream (Test);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Test_Premanent_Fallback;







|
>
>
>
>









<







299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319

320
321
322
323
324
325
326
   end Test_Local_Fallback;


   procedure Test_Premanent_Fallback (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Permanent fallback");
   begin
      declare
         Inter : constant Test_Interpreters.Interpreter
           := Test_Interpreters.Build
             ((Test_Interpreters.Item ("cmd", Recorder'(null record)),
               Test_Interpreters.Item ("command", Recorder'(null record))),
               Fallback => "cmd");
         Buffer : aliased Test_Tools.Memory_Stream;
         Printer : Printers.Canonical (Buffer'Access);
         Input : constant Caches.Reference := Invalid_Commands;
         Cursor : Caches.Cursor := Input.First;
      begin
         Buffer.Set_Expected (To_Atom
           ("7:not-cmd(14:7:not-cmd3:arg)13:not-a-command"
            & "(18:13:not-a-command())"));


         Inter.Execute (Cursor, Printer, True);

         Buffer.Check_Stream (Test);
      end;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Test_Premanent_Fallback;