12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Encodings;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Printers.Pretty.Config.Tests is
procedure Check_Param
(Test : in out NT.Test;
Result : in Parameters;
|
>
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Encodings;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers.Pretty.Config.Commands.T;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Printers.Pretty.Config.Tests is
procedure Check_Param
(Test : in out NT.Test;
Result : in Parameters;
|
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
|
Newline => CR_LF);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In first expression:");
Input.Write (To_Atom
("(indentation 3 spaces)width(token extended)"
& "(newline (not close-close))"));
Expected.Indentation := 3;
Expected.Indent := Spaces;
Expected.Width := 0;
Expected.Token := Extended_Token;
Expected.Newline_At (Closing, Closing) := False;
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In second expression:");
Input.Write (To_Atom
("(indentation 4 tabbed-spaces)upper-hex(width (10))(token)"));
Expected.Indentation := 4;
Expected.Indent := Tabs_And_Spaces;
Expected.Hex_Casing := Encodings.Upper;
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In third expression:");
Input.Write (To_Atom
("no-indentation(token never)"));
Expected.Indentation := 0;
Expected.Token := No_Token;
Test_Tools.Next_And_Check (Test, Parser, Events.Add_Atom, 0);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In fourth expression:");
Input.Write (To_Atom
("lower-case(token standard)"));
Expected.Token := Standard_Token;
Expected.Hex_Casing := Encodings.Lower;
Test_Tools.Next_And_Check (Test, Parser, Events.Add_Atom, 0);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In fifth expression:");
end;
exception
when Error : others => Test.Report_Exception (Error);
end Read_Test;
procedure Write_Test (Report : in out NT.Reporter'Class) is
|
>
>
>
|
>
|
>
>
>
>
>
>
|
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
305
306
307
308
309
310
311
312
|
Newline => CR_LF);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In first expression:");
Input.Write (To_Atom
("(indentation 3 spaces)width(token extended)"
& "LF(quoted never)"
& "(newline (not close-close))"));
Expected.Indentation := 3;
Expected.Indent := Spaces;
Expected.Width := 0;
Expected.Token := Extended_Token;
Expected.Newline_At (Closing, Closing) := False;
Expected.Newline := LF;
Expected.Quoted := No_Quoted;
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In second expression:");
Input.Write (To_Atom
("(indentation 4 tabbed-spaces)upper-hex(width (10))(token)"));
Expected.Indentation := 4;
Expected.Indent := Tabs_And_Spaces;
Expected.Hex_Casing := Encodings.Upper;
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In third expression:");
Input.Write (To_Atom
("no-indentation(token never)(newline)(width 72)"));
Expected.Indentation := 0;
Expected.Token := No_Token;
Expected.Width := 72;
Test_Tools.Next_And_Check (Test, Parser, Events.Add_Atom, 0);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In fourth expression:");
Input.Write (To_Atom
("lower-case(token standard)(width 0:)"));
Expected.Token := Standard_Token;
Expected.Hex_Casing := Encodings.Lower;
Test_Tools.Next_And_Check (Test, Parser, Events.Add_Atom, 0);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In fifth expression:");
Input.Write (To_Atom
("(token unrecognized-junk)(width 0xBAD)"));
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Update (Param, Parser);
Check_Param (Test, Param, Expected, "In sixth expression:");
end;
exception
when Error : others => Test.Report_Exception (Error);
end Read_Test;
procedure Write_Test (Report : in out NT.Reporter'Class) is
|