111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
+
|
Basic_Printing (Report);
Atom_Encodings (Report);
Separators (Report);
Atom_Width (Report);
Quoted_String_Escapes (Report);
Indentation (Report);
Newline_Formats (Report);
Token_Separation (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
|
617
618
619
620
621
622
623
624
|
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
Test_Exp (Pr);
Check_Stream (Test, Output);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Separators;
procedure Token_Separation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Token separation");
Token : constant Atom := To_Atom ("token");
begin
declare
Output : aliased Test_Tools.Memory_Stream;
Pr : Printer (Output'Access);
begin
Output.Set_Expected (To_Atom
("(begin(token ""quoted\n""token token #4865780A#token "
& "|QmFzZS02NAo=|token)end)"));
Pr.Set_Parameters
((Width => 0,
Newline_At => (others => (others => False)),
Space_At => (others => (others => False)),
Tab_Stop => 8,
Indentation => 0,
Indent => Spaces,
Quoted => When_Shorter,
Token => Standard_Token,
Hex_Casing => Encodings.Upper,
Quoted_Escape => Hex_Escape,
Char_Encoding => ASCII,
Fallback => Hexadecimal,
Newline => LF));
Pr.Open_List;
Pr.Append_Atom (To_Atom ("begin"));
Pr.Open_List;
Pr.Append_Atom (Token);
Pr.Append_Atom (To_Atom ("quoted" & Latin_1.LF));
Pr.Append_Atom (Token);
Pr.Append_Atom (Token);
Pr.Set_Quoted (No_Quoted);
Pr.Append_Atom (To_Atom ("Hex" & Latin_1.LF));
Pr.Append_Atom (Token);
Pr.Set_Fallback (Base64);
Pr.Append_Atom (To_Atom ("Base-64" & Latin_1.LF));
Pr.Append_Atom (Token);
Pr.Close_List;
Pr.Append_Atom (To_Atom ("end"));
Pr.Close_List;
Check_Stream (Test, Output);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Token_Separation;
end Natools.S_Expressions.Printers.Pretty.Tests;
|