@@ -4,6 +4,7 @@ module test_filesystem
4
4
make_directory, remove_directory, make_directory_all, is_windows, OS_TYPE, &
5
5
OS_WINDOWS, exists, type_unknown, type_regular_file, type_directory, type_symlink
6
6
use stdlib_error, only: state_type, STDLIB_FS_ERROR
7
+ use stdlib_strings, only: to_string
7
8
8
9
implicit none
9
10
@@ -88,7 +89,8 @@ subroutine test_exists_reg_file(error)
88
89
return
89
90
end if
90
91
91
- call check(error, t == type_regular_file, " exists incorrectly identifies type of reg files!" )
92
+ call check(error, t == type_regular_file, " exists incorrectly identifies type of &
93
+ reg files!: type=" // to_string(t))
92
94
93
95
if (allocated (error)) then
94
96
! Clean up: remove the file
@@ -123,17 +125,18 @@ subroutine test_exists_dir(error)
123
125
if (allocated (error)) then
124
126
! Clean up: remove the directory
125
127
call execute_command_line(" rmdir " // dirname, exitstat= ios, cmdstat= iocmd, cmdmsg= msg)
126
- call check(error, ios == 0 .and. iocmd == 0 , err% message // " and &
128
+ call check(error, ios == 0 .and. iocmd == 0 , err% message // " and &
127
129
& cannot cleanup test_exists_dir: " // trim (msg))
128
130
return
129
131
end if
130
132
131
- call check(error, t == type_directory, " exists incorrectly identifies type of directories!" )
133
+ call check(error, t == type_directory, " exists incorrectly identifies type of &
134
+ directories!: type=" // to_string(t))
132
135
133
136
if (allocated (error)) then
134
137
! Clean up: remove the directory
135
138
call execute_command_line(" rmdir " // dirname, exitstat= ios, cmdstat= iocmd, cmdmsg= msg)
136
- call check(error, ios == 0 .and. iocmd == 0 , err% message // " and &
139
+ call check(error, ios == 0 .and. iocmd == 0 , err% message // " and &
137
140
& cannot cleanup test_exists_dir: " // trim (msg))
138
141
return
139
142
end if
@@ -184,17 +187,18 @@ subroutine test_exists_symlink(error)
184
187
return
185
188
end if
186
189
187
- call check(error, t == type_symlink, " exists incorrectly identifies type of symlinks!" )
190
+ call check(error, t == type_symlink, " exists incorrectly identifies type of &
191
+ symlinks!: type=" // to_string(t))
188
192
189
193
if (allocated (error)) then
190
194
! Clean up: remove the link
191
195
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 &
196
+ call check(error, ios == 0 .and. iocmd == 0 , err% message // " and &
193
197
& cannot delete link: " // trim (msg))
194
198
195
199
! Clean up: remove the target
196
200
close (iunit,status= ' delete' ,iostat= ios,iomsg= msg)
197
- call check(error, ios == 0 , err% message // " and cannot delete target: " // trim (msg))
201
+ call check(error, ios == 0 , err% message // " and cannot delete target: " // trim (msg))
198
202
return
199
203
end if
200
204
@@ -205,7 +209,7 @@ subroutine test_exists_symlink(error)
205
209
if (allocated (error)) then
206
210
! Clean up: remove the target
207
211
close (iunit,status= ' delete' ,iostat= ios,iomsg= msg)
208
- call check(error, ios == 0 , err% message // " and cannot delete target: " // trim (msg))
212
+ call check(error, ios == 0 , err% message // " and cannot delete target: " // trim (msg))
209
213
end if
210
214
end subroutine test_exists_symlink
211
215
0 commit comments