1
1
module test_path
2
2
use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test
3
3
use stdlib_system, only: join_path, operator (/ ), split_path, OS_TYPE, OS_WINDOWS, &
4
- is_abs , abs_path, get_cwd
4
+ is_abs_path , abs_path, get_cwd
5
5
use stdlib_error, only: state_type
6
6
implicit none
7
7
contains
@@ -14,7 +14,7 @@ subroutine collect_suite(testsuite)
14
14
new_unittest(' test_join_path' , test_join_path), &
15
15
new_unittest(' test_join_path_operator' , test_join_path_op), &
16
16
new_unittest(' test_split_path' , test_split_path), &
17
- new_unittest(' test_is_abs ' , test_is_abs ), &
17
+ new_unittest(' test_is_abs_path ' , test_is_abs_path ), &
18
18
new_unittest(' test_abs_path' , test_abs_path) &
19
19
]
20
20
end subroutine collect_suite
@@ -122,68 +122,68 @@ subroutine test_split_path(error)
122
122
end if
123
123
end subroutine test_split_path
124
124
125
- subroutine test_is_abs (error )
125
+ subroutine test_is_abs_path (error )
126
126
type (error_type), allocatable , intent (out ) :: error
127
127
character (:), allocatable :: p
128
128
logical :: res
129
129
130
- character (* ), parameter :: msg = " is_abs : "
130
+ character (* ), parameter :: msg = " is_abs_path : "
131
131
132
132
if (OS_TYPE() == OS_WINDOWS) then
133
133
p = ' .'
134
- res = is_abs (p)
134
+ res = is_abs_path (p)
135
135
call check(error, .not. res, msg // p // " returns incorrect result" )
136
136
if (allocated (error)) return
137
137
138
138
p = ' ..'
139
- res = is_abs (p)
139
+ res = is_abs_path (p)
140
140
call check(error, .not. res, msg // p // " returns incorrect result" )
141
141
if (allocated (error)) return
142
142
143
143
p = ' C:\Windows'
144
- res = is_abs (p)
144
+ res = is_abs_path (p)
145
145
call check(error, res, msg // p // " returns incorrect result" )
146
146
if (allocated (error)) return
147
147
148
148
! a relative path pointing to the `Windows` folder
149
149
! in the current working directory in the drive C
150
150
p = ' C:Windows'
151
- res = is_abs (p)
151
+ res = is_abs_path (p)
152
152
call check(error, .not. res, msg // p // " returns incorrect result" )
153
153
if (allocated (error)) return
154
154
155
155
! UNC paths
156
156
p = ' \\server_name\share_name\path'
157
- res = is_abs (p)
157
+ res = is_abs_path (p)
158
158
call check(error, res, msg // p // " returns incorrect result" )
159
159
if (allocated (error)) return
160
160
else
161
161
p = ' .'
162
- res = is_abs (p)
162
+ res = is_abs_path (p)
163
163
call check(error, .not. res, msg // p // " returns incorrect result" )
164
164
if (allocated (error)) return
165
165
166
166
p = ' ..'
167
- res = is_abs (p)
167
+ res = is_abs_path (p)
168
168
call check(error, .not. res, msg // p // " returns incorrect result" )
169
169
if (allocated (error)) return
170
170
171
171
p = ' /'
172
- res = is_abs (p)
172
+ res = is_abs_path (p)
173
173
call check(error, res, msg // p // " returns incorrect result" )
174
174
if (allocated (error)) return
175
175
176
176
p = ' /home/Alice'
177
- res = is_abs (p)
177
+ res = is_abs_path (p)
178
178
call check(error, res, msg // p // " returns incorrect result" )
179
179
if (allocated (error)) return
180
180
181
181
p = ' ./home/Alice'
182
- res = is_abs (p)
182
+ res = is_abs_path (p)
183
183
call check(error, .not. res, msg // p // " returns incorrect result" )
184
184
if (allocated (error)) return
185
185
end if
186
- end subroutine test_is_abs
186
+ end subroutine test_is_abs_path
187
187
188
188
subroutine test_abs_path (error )
189
189
type (error_type), allocatable , intent (out ) :: error
@@ -201,7 +201,7 @@ subroutine test_abs_path(error)
201
201
call check(error, err% ok(), " Could not get absolute path: " // err% print ())
202
202
if (allocated (error)) return
203
203
204
- call check(error, is_abs (absolute_path), " absolute path created is not absolute" )
204
+ call check(error, is_abs_path (absolute_path), " absolute path created is not absolute" )
205
205
if (allocated (error)) return
206
206
207
207
call get_cwd(cwd, err)
0 commit comments