Skip to content

Commit 1c4e5f7

Browse files
committed
windows specific path for tests
1 parent 81339e7 commit 1c4e5f7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/specs/stdlib_system.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ Experimental
582582

583583
It creates an empty directory with default permissions.
584584
It also creates all the parent directories required in doing so.
585-
It is designed to work across multiple platforms. On Windows, paths with both forward `/` and backward `\` slashes are accepted.
586585

587586
### Syntax
588587

test/system/test_filesystem.f90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module test_filesystem
22
use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
33
use stdlib_system, only: is_directory, delete_file, FS_ERROR, FS_ERROR_CODE, &
4-
make_directory, remove_directory, make_directory_all, is_windows
4+
make_directory, remove_directory, make_directory_all, is_windows, OS_TYPE, &
5+
OS_WINDOWS
56
use stdlib_error, only: state_type, STDLIB_FS_ERROR
67

78
implicit none
@@ -226,7 +227,11 @@ subroutine test_make_directory_all(error)
226227
integer :: ios,iocmd
227228
character(len=512) :: msg
228229

229-
dir_name = "d1/d2/d3/d4/"
230+
if (OS_TYPE() == OS_WINDOWS) then
231+
dir_name = "d1\d2\d3\d4\"
232+
else
233+
dir_name = "d1/d2/d3/d4/"
234+
end if
230235

231236
call make_directory_all(dir_name, err=err)
232237
call check(error, err%ok(), 'Could not make all directories: '//err%print())

0 commit comments

Comments
 (0)