Natools

Check-in [3b7e398512]
Login
Overview
Comment:s_expressions-printers-tests: use the new Append_String procedure to keep full ocoverage
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b7e398512d09631fe43f3793e1ccc78b2ef8dd7
User & Date: nat on 2015-05-03 16:22:23
Other Links: manifest | tags
Context
2015-05-12
20:52
s_expressions-enumeration_io; new package providing tools to help I/O of enumerations in S-expressions check-in: dd030195a1 user: nat tags: trunk
2015-05-03
16:22
s_expressions-printers-tests: use the new Append_String procedure to keep full ocoverage check-in: 3b7e398512 user: nat tags: trunk
2015-05-02
14:04
printers: add a new class-wide procedure to append strings, which often improves readibility check-in: 94f83b5035 user: nat tags: trunk
Changes

Modified tests/natools-s_expressions-printers-tests.adb from [4ea2bd5d96] to [ccecba6ae8].

1
2
3
4
5
6
7
8
9
------------------------------------------------------------------------------
-- Copyright (c) 2014, 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         --

|







1
2
3
4
5
6
7
8
9
------------------------------------------------------------------------------
-- Copyright (c) 2014-2015, 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         --
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
         Stream : aliased Test_Tools.Memory_Stream;
         Printer : Canonical (Stream'Access);
      begin
         Stream.Set_Expected (To_Atom
           ("3:The(5:quick((5:brown3:fox)()))"
            & "(5:jumps)9:over3:the()4:lazy0:3:dog"));

         Printer.Append_Atom (To_Atom ("The"));
         Printer.Open_List;
         Printer.Append_Atom (To_Atom ("quick"));
         Printer.Open_List;
         Printer.Open_List;
         Printer.Append_Atom (To_Atom ("brown"));
         Printer.Append_Atom (To_Atom ("fox"));
         Printer.Close_List;
         Printer.Open_List;
         Printer.Close_List;
         Printer.Close_List;
         Printer.Close_List;
         Printer.Open_List;
         Printer.Append_Atom (To_Atom ("jumps"));
         Printer.Close_List;
         Printer.Append_Atom (To_Atom ("over3:the"));
         Printer.Open_List;
         Printer.Close_List;
         Printer.Append_Atom (To_Atom ("lazy"));
         Printer.Append_Atom (Null_Atom);
         Printer.Append_Atom (To_Atom ("dog"));

         if Stream.Has_Mismatch
           or else Stream.Unread_Expected /= Null_Atom
         then
            Report.Item (Name, NT.Fail);
            Report.Info ("Mismatch at position"
              & Count'Image (Stream.Mismatch_Index));







|

|


|
|






|

|


|

|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
         Stream : aliased Test_Tools.Memory_Stream;
         Printer : Canonical (Stream'Access);
      begin
         Stream.Set_Expected (To_Atom
           ("3:The(5:quick((5:brown3:fox)()))"
            & "(5:jumps)9:over3:the()4:lazy0:3:dog"));

         Printer.Append_String ("The");
         Printer.Open_List;
         Printer.Append_String ("quick");
         Printer.Open_List;
         Printer.Open_List;
         Printer.Append_String ("brown");
         Printer.Append_String ("fox");
         Printer.Close_List;
         Printer.Open_List;
         Printer.Close_List;
         Printer.Close_List;
         Printer.Close_List;
         Printer.Open_List;
         Printer.Append_String ("jumps");
         Printer.Close_List;
         Printer.Append_String ("over3:the");
         Printer.Open_List;
         Printer.Close_List;
         Printer.Append_String ("lazy");
         Printer.Append_Atom (Null_Atom);
         Printer.Append_String ("dog");

         if Stream.Has_Mismatch
           or else Stream.Unread_Expected /= Null_Atom
         then
            Report.Item (Name, NT.Fail);
            Report.Info ("Mismatch at position"
              & Count'Image (Stream.Mismatch_Index));