Skip to content

Commit c58be5e

Browse files
committed
add err handling to read in tests
1 parent d047e1f commit c58be5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/system/test_filesystem.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ subroutine test_get_file_size_file(error)
389389
call check(error, size == 0 .and. err%ok(), "Empty file has a non-zero size!: " // to_string(size))
390390

391391
text = "Hello, World!"
392-
write(iunit, '(A)', advance='NO') text ! no newlines or additional bytes
392+
write(iunit, '(A)', advance='NO', iostat=ios, iomsg=msg) text ! no newlines or additional bytes
393+
call check(error, ios == 0, "Cannot write to test file: " // trim(msg))
393394
flush(iunit) ! flush the buffer
394395

395396
! get the size of the file => should be len(text)

0 commit comments

Comments
 (0)