@@ -17,6 +17,7 @@ subroutine collect_filesystem(testsuite)
1717 type (unittest_type), allocatable , intent (out ) :: testsuite(:)
1818
1919 testsuite = [ &
20+ new_unittest(" fs_file_is_windows" , fs_is_windows), &
2021 new_unittest(" fs_file_not_exists" , fs_file_not_exists, should_fail= .true. ), &
2122 new_unittest(" fs_file_exists" , fs_file_exists), &
2223 new_unittest(" fs_current_dir_exists" , fs_current_dir_exists), &
@@ -30,6 +31,20 @@ subroutine collect_filesystem(testsuite)
3031 ]
3132 end
3233
34+ subroutine fs_is_windows (error )
35+ type (error_type), allocatable , intent (out ) :: error
36+
37+ character (len= 255 ) :: value
38+ integer :: length, stat
39+
40+ call get_environment_variable(' HOMEDRIVE' , value, length, stat)
41+ if (is_windows()) then
42+ call check(error, stat == 0 .and. length > 0 , " Windows should be detected." )
43+ else
44+ call check(error, stat /= 0 .and. length == 0 , " Windows should not be detected." )
45+ end if
46+ end
47+
3348 subroutine fs_file_not_exists (error )
3449 type (error_type), allocatable , intent (out ) :: error
3550
0 commit comments