aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-02-05 12:44:47 +0100
committerBjörn Gustavsson <[email protected]>2013-02-08 13:21:41 +0100
commit0aed93263414750a63d65908599ca2e73943b0a7 (patch)
tree9005e2e8b29a1602222bc54ec2138c938c1a0eae /lib/kernel/test
parent14966543730096365d4fddc5ac1dce8554c40d7c (diff)
downloadotp-0aed93263414750a63d65908599ca2e73943b0a7.tar.gz
otp-0aed93263414750a63d65908599ca2e73943b0a7.tar.bz2
otp-0aed93263414750a63d65908599ca2e73943b0a7.zip
Test that list_dir("non-existing-dir") fails with the correct error
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 4e93a593b3..9aa0204a16 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -49,7 +49,8 @@
make_link_a/1, make_link_b/1,
read_link_info_for_non_link/1,
symlinks_a/1, symlinks_b/1,
- list_dir_limit/1]).
+ list_dir_limit/1,
+ list_dir_error/1]).
-export([advise/1]).
-export([large_write/1]).
@@ -110,7 +111,7 @@ groups() ->
write_compressed, compress_errors]},
{links, [],
[make_link_a, make_link_b, read_link_info_for_non_link,
- symlinks_a, symlinks_b]}].
+ symlinks_a, symlinks_b, list_dir_error]}].
init_per_group(_GroupName, Config) ->
Config.
@@ -2140,6 +2141,16 @@ list_dir_limit_cleanup(Dir, Handle, N, Cnt) ->
list_dir_limit_cleanup(Dir, Handle, N, Cnt+1).
%%%
+%%% Test list_dir() on a non-existing pathname.
+%%%
+
+list_dir_error(Config) ->
+ Priv = ?config(priv_dir, Config),
+ NonExisting = filename:join(Priv, "non-existing-dir"),
+ {error,enoent} = prim_file:list_dir(NonExisting),
+ ok.
+
+%%%
%%% Support for testing large files.
%%%