Index: tests/natools-s_expressions-atom_buffers-tests.adb ================================================================== --- tests/natools-s_expressions-atom_buffers-tests.adb +++ tests/natools-s_expressions-atom_buffers-tests.adb @@ -31,10 +31,11 @@ Test_Query_Null (Report); Test_Reset (Report); Test_Reverse_Append (Report); Test_Invert (Report); Test_Empty_Append (Report); + Test_Stream_Interface (Report); end All_Tests; ---------------------- @@ -462,6 +463,29 @@ end; exception when Error : others => Test.Report_Exception (Error); end Test_Empty_Append; + + procedure Test_Stream_Interface (Report : in out NT.Reporter'Class) is + Test : NT.Test := Report.Item ("Stream interface"); + begin + declare + Buffer : Atom_Buffer; + Part_1 : constant Atom := To_Atom ("0123456789"); + Part_2 : constant Atom := To_Atom ("ABCDEF"); + Data : Atom (1 .. 10); + Last : Offset; + begin + Buffer.Write (Part_1 & Part_2); + Buffer.Read (Data, Last); + Test_Tools.Test_Atom (Test, Part_1, Data); + Test_Tools.Test_Atom (Test, Part_2, Buffer.Data); + Buffer.Read (Data, Last); + Test_Tools.Test_Atom (Test, Part_2, Data (Data'First .. Last)); + Test_Tools.Test_Atom (Test, Null_Atom, Buffer.Data); + end; + exception + when Error : others => Test.Report_Exception (Error); + end Test_Stream_Interface; + end Natools.S_Expressions.Atom_Buffers.Tests; Index: tests/natools-s_expressions-atom_buffers-tests.ads ================================================================== --- tests/natools-s_expressions-atom_buffers-tests.ads +++ tests/natools-s_expressions-atom_buffers-tests.ads @@ -35,7 +35,8 @@ procedure Test_Preallocate (Report : in out NT.Reporter'Class); procedure Test_Query (Report : in out NT.Reporter'Class); procedure Test_Query_Null (Report : in out NT.Reporter'Class); procedure Test_Reset (Report : in out NT.Reporter'Class); procedure Test_Reverse_Append (Report : in out NT.Reporter'Class); + procedure Test_Stream_Interface (Report : in out NT.Reporter'Class); end Natools.S_Expressions.Atom_Buffers.Tests;