Index: tests/natools-s_expressions-printers-pretty-config-tests.adb ================================================================== --- tests/natools-s_expressions-printers-pretty-config-tests.adb +++ tests/natools-s_expressions-printers-pretty-config-tests.adb @@ -14,10 +14,11 @@ -- 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 @@ -193,19 +194,31 @@ -- Complete Test Suite -- ------------------------- procedure All_Tests (Report : in out NT.Reporter'Class) is begin + Hash_Function_Test (Report); Read_Test (Report); Write_Test (Report); end All_Tests; ---------------------- -- Individual Tests -- ---------------------- + + procedure Hash_Function_Test (Report : in out NT.Reporter'Class) is + Test : NT.Test := Report.Item ("Interpreter hash functions"); + begin + if not Commands.T then + Test.Fail; + end if; + exception + when Error : others => Test.Report_Exception (Error); + end Hash_Function_Test; + procedure Read_Test (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Read from S-expression"); begin declare @@ -244,16 +257,19 @@ 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 @@ -264,24 +280,31 @@ 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)")); + ("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)")); + ("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; Index: tests/natools-s_expressions-printers-pretty-config-tests.ads ================================================================== --- tests/natools-s_expressions-printers-pretty-config-tests.ads +++ tests/natools-s_expressions-printers-pretty-config-tests.ads @@ -27,9 +27,10 @@ package NT renames Natools.Tests; procedure All_Tests (Report : in out NT.Reporter'Class); + procedure Hash_Function_Test (Report : in out NT.Reporter'Class); procedure Read_Test (Report : in out NT.Reporter'Class); procedure Write_Test (Report : in out NT.Reporter'Class); end Natools.S_Expressions.Printers.Pretty.Config.Tests;