Skip to content

Commit 5be9e94

Browse files
committed
improve test
1 parent dd10b5a commit 5be9e94

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/system/test_filesystem.f90

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,15 @@ subroutine test_exists_symlink(error)
166166
call execute_command_line(cmd, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
167167
else
168168
cmd = 'ln -s '//target_name//' '//link_name
169-
print *, cmd
170169
call execute_command_line(cmd, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
171-
cmd = 'mklink '//link_name//' '//target_name
172-
print *, cmd
173170
end if
174171

175172
call check(error, ios == 0 .and. iocmd == 0, "Cannot create symlink!: " // trim(msg))
176173

177174
if (allocated(error)) then
178175
! Clean up: remove the target
179176
close(iunit,status='delete',iostat=ios,iomsg=msg)
180-
call check(error, ios == 0, err%message // "and cannot delete target: " // trim(msg))
177+
call check(error, ios == 0, err%message // " and cannot delete target: " // trim(msg))
181178
return
182179
end if
183180

@@ -187,12 +184,12 @@ subroutine test_exists_symlink(error)
187184
if (allocated(error)) then
188185
! Clean up: remove the link
189186
call execute_command_line("rm " // link_name, exitstat=ios, cmdstat=iocmd, cmdmsg=msg)
190-
call check(error, ios == 0 .and. iocmd == 0, err%message // "and &
187+
call check(error, ios == 0 .and. iocmd == 0, err%message // " and &
191188
& cannot delete link: " // trim(msg))
192189

193190
! Clean up: remove the target
194191
close(iunit,status='delete',iostat=ios,iomsg=msg)
195-
call check(error, ios == 0, err%message // "and cannot delete target: " // trim(msg))
192+
call check(error, ios == 0, err%message // " and cannot delete target: " // trim(msg))
196193
return
197194
end if
198195

@@ -220,6 +217,10 @@ subroutine test_exists_symlink(error)
220217
close(iunit,status='delete',iostat=ios,iomsg=msg)
221218
call check(error, ios == 0, err%message // " and cannot delete target: " // trim(msg))
222219
end if
220+
221+
! Clean up: remove the target
222+
close(iunit,status='delete',iostat=ios,iomsg=msg)
223+
call check(error, ios == 0, "Cannot delete target: " // trim(msg))
223224
end subroutine test_exists_symlink
224225

225226
! Test `is_directory` for a directory

0 commit comments

Comments
 (0)