diff options
author | John Högberg <[email protected]> | 2017-10-13 14:47:33 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2017-11-30 15:44:36 +0100 |
commit | 601c9cd5e9440b78101ef9b73409ad3912f3981e (patch) | |
tree | 8995fb1c3d036400727ea2a1539187700551e208 /lib/kernel/test/file_SUITE.erl | |
parent | 072a991bc2eafb283cd25eaad1f4fd2f70c0f8b9 (diff) | |
download | otp-601c9cd5e9440b78101ef9b73409ad3912f3981e.tar.gz otp-601c9cd5e9440b78101ef9b73409ad3912f3981e.tar.bz2 otp-601c9cd5e9440b78101ef9b73409ad3912f3981e.zip |
get_cwd/1 on non-existent drives should error out
Diffstat (limited to 'lib/kernel/test/file_SUITE.erl')
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 3cb249c565..0cb8087a76 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -712,10 +712,15 @@ win_cur_dir_1(_Config) -> %% Get the drive letter from the current directory, %% and try to get current directory for that drive. - [Drive,$:|_] = BaseDir, - {ok,BaseDir} = ?FILE_MODULE:get_cwd([Drive,$:]), + [CurDrive,$:|_] = BaseDir, + {ok,BaseDir} = ?FILE_MODULE:get_cwd([CurDrive,$:]), io:format("BaseDir = ~s\n", [BaseDir]), + %% We should error out on non-existent drives. Any reasonable system will + %% have at least one. + CurDirs = [?FILE_MODULE:get_cwd([Drive,$:]) || Drive <- lists:seq($A, $Z)], + lists:member({error,eaccess}, CurDirs), + %% Unfortunately, there is no way to move away from the %% current drive as we can't use the "subst" command from %% a SSH connection. We can't test any more. |