Skip to content

Commit 7db17df

Browse files
committed
allocate character: add comparison test
1 parent 606e81a commit 7db17df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/character/character_allocatable.f90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ program character_alloctable
4848
allocate(character(3) :: flex(2))
4949
flex = [character(3) :: 'hi', 'bye']
5050
if (size(flex) /= 2) error stop
51-
if (len(flex(1)) /= 3) error stop
52-
if (len_trim(flex(1)) /= 2) error stop
51+
if (len(flex(1)) /= 3) error stop "flex: len(flex(1)) /= 3"
52+
if (len_trim(flex(1)) /= 2) error stop "flex: len_trim(flex(1)) /= 2"
53+
if (flex(1) /= 'hi') error stop "flex: flex(1) /= 'hi'"
54+
if (flex(2) /= 'bye') error stop "flex: flex(2) /= 'bye'"
55+
5356

5457
print *, "OK: allocatable character"
5558

0 commit comments

Comments
 (0)