Files
VSS/testsuite/text/test_string_buffer.adb
Vadim Godunko 120eea9eac Revert "Merge branch 'topic/vadim/text' into 'master'"
This reverts merge request !394
2025-08-21 11:03:15 +00:00

48 lines
1.0 KiB
Ada

--
-- Copyright (C) 2020-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
with VSS.Strings;
procedure Test_String_Buffer is
use type VSS.Strings.Virtual_String;
begin
-- Few append operations to null string.
declare
Buffer : VSS.Strings.Virtual_String;
begin
Buffer.Append ('A');
Buffer.Append ('ะ‘');
Buffer.Append ('เค•');
Buffer.Append ('๐Œˆ');
if Buffer /= VSS.Strings.To_Virtual_String ("Aะ‘เค•๐Œˆ") then
raise Program_Error;
end if;
end;
-- Few append operations to small initial string, enough to overlow
-- "in place" data buffer.
declare
Buffer : VSS.Strings.Virtual_String :=
VSS.Strings.To_Virtual_String ("********");
begin
Buffer.Append ('A');
Buffer.Append ('ะ‘');
Buffer.Append ('เค•');
Buffer.Append ('๐Œˆ');
if Buffer /= VSS.Strings.To_Virtual_String ("********Aะ‘เค•๐Œˆ") then
raise Program_Error;
end if;
end;
end Test_String_Buffer;