Skip to content

Commit 7882a2a

Browse files
committed
better test fail messages
1 parent cd61274 commit 7882a2a

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/system/test_filesystem.f90

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ subroutine test_exists_reg_file(error)
8888
return
8989
end if
9090

91-
call check(error, t == type_regular_file, "exists incorrectly identifies type of reg files!")
91+
call check(error, t == type_regular_file, "exists incorrectly identifies type of &
92+
reg files!: type=" // to_string(t))
9293

9394
if (allocated(error)) then
9495
! Clean up: remove the file
@@ -123,17 +124,18 @@ subroutine test_exists_dir(error)
123124
if (allocated(error)) then
124125
! Clean up: remove the directory
125126
call execute_command_line("rmdir " // dirname, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
126-
call check(error, ios == 0 .and. iocmd == 0, err%message // "and &
127+
call check(error, ios == 0 .and. iocmd == 0, err%message // " and &
127128
& cannot cleanup test_exists_dir: " // trim(msg))
128129
return
129130
end if
130131

131-
call check(error, t == type_directory, "exists incorrectly identifies type of directories!")
132+
call check(error, t == type_directory, "exists incorrectly identifies type of &
133+
directories!: type=" // to_string(t))
132134

133135
if (allocated(error)) then
134136
! Clean up: remove the directory
135137
call execute_command_line("rmdir " // dirname, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
136-
call check(error, ios == 0 .and. iocmd == 0, err%message // "and &
138+
call check(error, ios == 0 .and. iocmd == 0, err%message // " and &
137139
& cannot cleanup test_exists_dir: " // trim(msg))
138140
return
139141
end if
@@ -184,17 +186,18 @@ subroutine test_exists_symlink(error)
184186
return
185187
end if
186188

187-
call check(error, t == type_symlink, "exists incorrectly identifies type of symlinks!")
189+
call check(error, t == type_symlink, "exists incorrectly identifies type of &
190+
symlinks!: type=" // to_string(t))
188191

189192
if (allocated(error)) then
190193
! Clean up: remove the link
191194
call execute_command_line("rm " // link_name, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
192-
call check(error, ios == 0 .and. iocmd == 0, err%message // "and &
195+
call check(error, ios == 0 .and. iocmd == 0, err%message // " and &
193196
& cannot delete link: " // trim(msg))
194197

195198
! Clean up: remove the target
196199
close(iunit,status='delete',iostat=ios,iomsg=msg)
197-
call check(error, ios == 0, err%message // "and cannot delete target: " // trim(msg))
200+
call check(error, ios == 0, err%message // " and cannot delete target: " // trim(msg))
198201
return
199202
end if
200203

@@ -205,7 +208,7 @@ subroutine test_exists_symlink(error)
205208
if (allocated(error)) then
206209
! Clean up: remove the target
207210
close(iunit,status='delete',iostat=ios,iomsg=msg)
208-
call check(error, ios == 0, err%message // "and cannot delete target: " // trim(msg))
211+
call check(error, ios == 0, err%message // " and cannot delete target: " // trim(msg))
209212
end if
210213
end subroutine test_exists_symlink
211214

0 commit comments

Comments
 (0)