1
1
module test_path
2
2
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
4
4
implicit none
5
5
contains
6
6
! > Collect all exported unit tests
@@ -32,7 +32,7 @@ subroutine test_join_path(error)
32
32
character (len= :), allocatable :: path
33
33
character (len= 20 ) :: paths(5 )
34
34
35
- if (ISWIN ) then
35
+ if (OS_TYPE() == OS_WINDOWS ) then
36
36
path = join_path(' C:\Users' , ' Alice' )
37
37
call checkpath(error, ' join_path' , ' C:\Users\Alice' , path)
38
38
if (allocated (error)) return
@@ -43,8 +43,8 @@ subroutine test_join_path(error)
43
43
call checkpath(error, ' join_path' , ' C:\Users\Bob\Pictures\2025' , path)
44
44
if (allocated (error)) return
45
45
46
- path = join_path(' C:\Users\John Doe' , ' Pictures\2025' ) ! path with spaces
47
- call checkpath(error, ' join_path' , ' C:\Users\John Doe\Pictures\2025' , path)
46
+ path = join_path(' " C:\Users\John Doe" ' , ' Pictures\2025' ) ! path with spaces
47
+ call checkpath(error, ' join_path' , ' " C:\Users\John Doe" \Pictures\2025' , path)
48
48
if (allocated (error)) return
49
49
else
50
50
path = join_path(' /home' , ' Alice' )
@@ -64,7 +64,7 @@ subroutine test_join_path_op(error)
64
64
type (error_type), allocatable , intent (out ) :: error
65
65
character (len= :), allocatable :: path
66
66
67
- if (ISWIN ) then
67
+ if (OS_TYPE() == OS_WINDOWS ) then
68
68
path = ' C:' / ' Users' / ' Alice' / ' Desktop'
69
69
call checkpath(error, ' join_path operator' , ' C:\Users\Alice\Desktop' , path)
70
70
if (allocated (error)) return
@@ -85,7 +85,7 @@ subroutine test_split_path(error)
85
85
call checkpath(error, ' split_path-tail' , ' ' , tail)
86
86
if (allocated (error)) return
87
87
88
- if (ISWIN ) then
88
+ if (OS_TYPE() == OS_WINDOWS ) then
89
89
call split_path(' \\\\' , head, tail)
90
90
call checkpath(error, ' split_path-head' , ' \' , head)
91
91
if (allocated (error)) return
0 commit comments