5 ! Contributed by F Martinez Fadrique <fmartinez@gmv.com>
7 ! Fixed by the patch for PR59906 but adds another, different test.
9 module m_assertion_character
11 type :: t_assertion_character
12 character(len
=8) :: name
14 procedure
:: assertion_character
15 procedure
:: write => assertion_array_write
16 end type t_assertion_character
18 impure elemental
subroutine assertion_character( ast
, name
)
19 class(t_assertion_character
), intent(out
) :: ast
20 character(len
=*), intent(in
) :: name
22 end subroutine assertion_character
23 subroutine assertion_array_write( ast
, unit
)
24 class(t_assertion_character
), intent(in
) :: ast
25 character(*), intent(inOUT
) :: unit
26 write(unit
,*) trim (unit(2:len(unit
)))//trim (ast
%name
)
27 end subroutine assertion_array_write
28 end module m_assertion_character
30 module m_assertion_array_character
31 use m_assertion_character
33 type :: t_assertion_array_character
34 type(t_assertion_character
), dimension(:), allocatable
:: rast
36 procedure
:: assertion_array_character
37 procedure
:: write => assertion_array_character_write
38 end type t_assertion_array_character
40 subroutine assertion_array_character( ast
, name
, nast
)
41 class(t_assertion_array_character
), intent(out
) :: ast
42 character(len
=*), intent(in
) :: name
43 integer, intent(in
) :: nast
45 allocate ( ast
%rast(nast
) )
46 call ast
%rast
%assertion_character ( name
)
47 end subroutine assertion_array_character
48 subroutine assertion_array_character_write( ast
, unit
)
49 class(t_assertion_array_character
), intent(in
) :: ast
50 CHARACTER(*), intent(inOUT
) :: unit
52 do i
= 1, size (ast
%rast
)
53 call ast
%rast(i
)%write (unit
)
55 end subroutine assertion_array_character_write
56 end module m_assertion_array_character
59 use m_assertion_array_character
61 type(t_assertion_array_character
) :: ast
62 character(len
=8) :: name
63 character (26) :: line
= ''
65 call ast
%assertion_array_character ( name
, 5 )
67 if (line(2:len (line
)) .ne
. "testtesttesttesttest") call abort