107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Basic_Printing (Report);
Atom_Encodings (Report);
Separators (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
|
>
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Basic_Printing (Report);
Atom_Encodings (Report);
Separators (Report);
Atom_Width (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
Param.Token := Extended_Token;
Parse_Print_Test (Test, Param,
To_Atom ("(extended token 123 encoding)"));
exception
when Error : others => Test.Report_Exception (Error);
end Atom_Encodings;
procedure Basic_Printing (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Basic printing");
begin
declare
Output : aliased Test_Tools.Memory_Stream;
P : Printer (Output'Access);
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
151
152
153
154
155
156
157
158
159
160
161
162
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
Param.Token := Extended_Token;
Parse_Print_Test (Test, Param,
To_Atom ("(extended token 123 encoding)"));
exception
when Error : others => Test.Report_Exception (Error);
end Atom_Encodings;
procedure Atom_Width (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Atom width");
Param : Parameters
:= (Width => 10,
Newline_At => (others => (others => False)),
Space_At => (others => (others => False)),
Tab_Stop => 8,
Indentation => 3,
Indent => Spaces,
Quoted => No_Quoted,
Token => No_Token,
Hex_Casing => Encodings.Upper,
Quoted_Escape => Hex_Escape,
Char_Encoding => ASCII,
Fallback => Hexadecimal,
Newline => LF);
begin
declare
Output : aliased Test_Tools.Memory_Stream;
Pr : Printer (Output'Access);
begin
Output.Set_Expected (To_Atom ("(" & Latin_1.LF
& " #303132" & Latin_1.LF
& " 333435" & Latin_1.LF
& " 3637#)"));
Pr.Set_Parameters (Param);
Pr.Open_List;
Pr.Append_Atom (To_Atom ("01234567"));
Pr.Close_List;
Check_Stream (Test, Output);
end;
Param.Fallback := Base64;
declare
Output : aliased Test_Tools.Memory_Stream;
Pr : Printer (Output'Access);
begin
Output.Set_Expected (To_Atom ("(" & Latin_1.LF
& " | YWJj" & Latin_1.LF
& " REVG" & Latin_1.LF
& " Z2hp" & Latin_1.LF
& " SktM" & Latin_1.LF
& " |)"));
Pr.Set_Parameters (Param);
Pr.Open_List;
Pr.Append_Atom (To_Atom ("abcDEFghiJKL"));
Pr.Close_List;
Check_Stream (Test, Output);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Atom_Width;
procedure Basic_Printing (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Basic printing");
begin
declare
Output : aliased Test_Tools.Memory_Stream;
P : Printer (Output'Access);
|