aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-09-11 15:03:53 +0200
committerBjörn Gustavsson <[email protected]>2012-09-12 09:28:31 +0200
commit70b5e24c9498225fadc08d19503269c8aad851bf (patch)
tree2f8388de5d5bccb89b620c3fe8683da0bbb77418 /lib/stdlib/test
parentd1a037921309a48cd80db1c53f4de4bb08ae4f4f (diff)
downloadotp-70b5e24c9498225fadc08d19503269c8aad851bf.tar.gz
otp-70b5e24c9498225fadc08d19503269c8aad851bf.tar.bz2
otp-70b5e24c9498225fadc08d19503269c8aad851bf.zip
Fix filelib:wildcard/2
filelib:wildcard("some/relative/path/*.beam", Path) would fail to match any file. That is, filelib:wildcard/2 would not work if the first component of the pattern did not contain any wildcard characters. Noticed-by: Samuel Rivas
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 1de639a166..94da355f36 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -176,9 +176,19 @@ do_wildcard_5(Dir, Wcf) ->
%% Cleanup
?line del(Files),
- ?line foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs).
-
-
+ ?line foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs),
+ do_wildcard_6(Dir, Wcf).
+
+do_wildcard_6(Dir, Wcf) ->
+ ok = file:make_dir(filename:join(Dir, "xbin")),
+ All = ["xbin/a.x","xbin/b.x","xbin/c.x"],
+ Files = mkfiles(All, Dir),
+ All = Wcf("xbin/*.x"),
+ All = Wcf("xbin/*"),
+ ["xbin"] = Wcf("*"),
+ All = Wcf("*/*"),
+ del(Files),
+ ok = file:del_dir(filename:join(Dir, "xbin")).
fold_files(Config) when is_list(Config) ->
?line Dir = filename:join(?config(priv_dir, Config), "fold_files"),