aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-11-18 11:35:15 +0100
committerBjörn Gustavsson <[email protected]>2016-11-18 11:35:15 +0100
commitc8fe3c7504a5dc9a0e6d884ba66fed9a5c47e3fb (patch)
tree8530560372bec1b79e4e5574d1bbf4ef0ef73448 /lib
parent8658ca4b64f96f9691f0f0a70b02ff479fa50642 (diff)
parent6acf223a1f962da96062bf42a8d5e85446930d99 (diff)
downloadotp-c8fe3c7504a5dc9a0e6d884ba66fed9a5c47e3fb.tar.gz
otp-c8fe3c7504a5dc9a0e6d884ba66fed9a5c47e3fb.tar.bz2
otp-c8fe3c7504a5dc9a0e6d884ba66fed9a5c47e3fb.zip
Merge branch 'bjorn/cuddle-with-tests' into maint
* bjorn/cuddle-with-tests: Correct tar_SUITE:unicode/1
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/test/tar_SUITE.erl26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl
index 64dd41e75a..6f3979bb77 100644
--- a/lib/stdlib/test/tar_SUITE.erl
+++ b/lib/stdlib/test/tar_SUITE.erl
@@ -720,20 +720,25 @@ memory(Config) when is_list(Config) ->
%% Test filenames with characters outside the US ASCII range.
unicode(Config) when is_list(Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- do_unicode(PrivDir),
+ run_unicode_node(Config, "+fnu"),
case has_transparent_naming() of
true ->
- Pa = filename:dirname(code:which(?MODULE)),
- Node = start_node(unicode, "+fnl -pa "++Pa),
- ok = rpc:call(Node, erlang, apply,
- [fun() -> do_unicode(PrivDir) end,[]]),
- true = test_server:stop_node(Node),
- ok;
+ run_unicode_node(Config, "+fnl");
false ->
ok
end.
+run_unicode_node(Config, Option) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Pa = filename:dirname(code:which(?MODULE)),
+ Args = Option ++ " -pa "++Pa,
+ io:format("~s\n", [Args]),
+ Node = start_node(unicode, Args),
+ ok = rpc:call(Node, erlang, apply,
+ [fun() -> do_unicode(PrivDir) end,[]]),
+ true = test_server:stop_node(Node),
+ ok.
+
has_transparent_naming() ->
case os:type() of
{unix,darwin} -> false;
@@ -745,10 +750,11 @@ do_unicode(PrivDir) ->
ok = file:set_cwd(PrivDir),
ok = file:make_dir("unicöde"),
- Names = unicode_create_files(),
+ Names = lists:sort(unicode_create_files()),
Tar = "unicöde.tar",
ok = erl_tar:create(Tar, ["unicöde"], []),
- {ok,Names} = erl_tar:table(Tar, []),
+ {ok,Names0} = erl_tar:table(Tar, []),
+ Names = lists:sort(Names0),
_ = [ok = file:delete(Name) || Name <- Names],
ok = erl_tar:extract(Tar),
_ = [{ok,_} = file:read_file(Name) || Name <- Names],