vss_24.0.0_b4d0be7c/testsuite/stream/test_stream_element_vector-test_conversions.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
--
--  Copyright (C) 2022, AdaCore
--
--  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--

with Ada.Strings.Unbounded;

separate (Test_Stream_Element_Vector)

procedure Test_Conversions is
   U : constant Ada.Strings.Unbounded.Unbounded_String :=
     Ada.Strings.Unbounded.To_Unbounded_String ("ABC123");
   V : constant VSS.Stream_Element_Vectors.Stream_Element_Vector :=
     VSS.Stream_Element_Vectors.Conversions.Unchecked_From_Unbounded_String
       (U);
   S : constant String :=
     VSS.Stream_Element_Vectors.Conversions.Unchecked_To_String (V);

begin
   Test_Support.Assert (S = Ada.Strings.Unbounded.To_String (U));
end Test_Conversions;