11module test_path
22 use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
3- use stdlib_system, only: join_path, operator (/ ), split_path, ISWIN
3+ use stdlib_system, only: join_path, operator (/ ), split_path, OS_TYPE, OS_WINDOWS
44 implicit none
55contains
66 ! > Collect all exported unit tests
@@ -32,7 +32,7 @@ subroutine test_join_path(error)
3232 character (len= :), allocatable :: path
3333 character (len= 20 ) :: paths(5 )
3434
35- if (ISWIN ) then
35+ if (OS_TYPE() == OS_WINDOWS ) then
3636 path = join_path(' C:\Users' , ' Alice' )
3737 call checkpath(error, ' join_path' , ' C:\Users\Alice' , path)
3838 if (allocated (error)) return
@@ -43,8 +43,8 @@ subroutine test_join_path(error)
4343 call checkpath(error, ' join_path' , ' C:\Users\Bob\Pictures2025円' , path)
4444 if (allocated (error)) return
4545
46- path = join_path(' C:\Users\John Doe' , ' Pictures2025円' ) ! path with spaces
47- call checkpath(error, ' join_path' , ' C:\Users\John Doe\Pictures2025円' , path)
46+ path = join_path(' " C:\Users\John Doe" ' , ' Pictures2025円' ) ! path with spaces
47+ call checkpath(error, ' join_path' , ' " C:\Users\John Doe" \Pictures2025円' , path)
4848 if (allocated (error)) return
4949 else
5050 path = join_path(' /home' , ' Alice' )
@@ -64,7 +64,7 @@ subroutine test_join_path_op(error)
6464 type (error_type), allocatable , intent (out ) :: error
6565 character (len= :), allocatable :: path
6666
67- if (ISWIN ) then
67+ if (OS_TYPE() == OS_WINDOWS ) then
6868 path = ' C:' / ' Users' / ' Alice' / ' Desktop'
6969 call checkpath(error, ' join_path operator' , ' C:\Users\Alice\Desktop' , path)
7070 if (allocated (error)) return
@@ -85,7 +85,7 @@ subroutine test_split_path(error)
8585 call checkpath(error, ' split_path-tail' , ' ' , tail)
8686 if (allocated (error)) return
8787
88- if (ISWIN ) then
88+ if (OS_TYPE() == OS_WINDOWS ) then
8989 call split_path(' \\\\' , head, tail)
9090 call checkpath(error, ' split_path-head' , ' \' , head)
9191 if (allocated (error)) return
0 commit comments