aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2013-08-28 14:05:08 +0200
committerDan Gudmundsson <[email protected]>2014-01-21 10:56:50 +0100
commit048400b08872d95ce7a8b48e346b49971acb6506 (patch)
tree4176a0d94084f0ba1e738cc6b1d87a1448c7a4f2 /lib
parent248e2eb0462e5d180b2c35a726aba734ce2c2182 (diff)
downloadotp-048400b08872d95ce7a8b48e346b49971acb6506.tar.gz
otp-048400b08872d95ce7a8b48e346b49971acb6506.tar.bz2
otp-048400b08872d95ce7a8b48e346b49971acb6506.zip
Fix testing with unicode paths
re needs unicode option
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/test/compilation_SUITE.erl6
-rw-r--r--lib/kernel/test/code_SUITE.erl7
-rw-r--r--lib/stdlib/test/shell_SUITE.erl18
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl2
4 files changed, 18 insertions, 15 deletions
diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl
index 93b2fb4ea5..f7b1dbdddf 100644
--- a/lib/compiler/test/compilation_SUITE.erl
+++ b/lib/compiler/test/compilation_SUITE.erl
@@ -196,7 +196,7 @@ redundant_case_1(_) -> d.
failure(Module, Conf) ->
?line Src = filename:join(?config(data_dir, Conf), atom_to_list(Module)),
?line Out = ?config(priv_dir,Conf),
- ?line io:format("Compiling: ~s\n", [Src]),
+ ?line io:format("Compiling: ~ts\n", [Src]),
?line CompRc = compile:file(Src, [{outdir,Out},return,time]),
?line io:format("Result: ~p\n",[CompRc]),
?line case CompRc of
@@ -476,8 +476,8 @@ self_compile_node(CompilerDir, OutDir, Version, Opts) ->
ok.
compile_compiler(Files, OutDir, Version, InlineOpts) ->
- io:format("~s", [code:which(compile)]),
- io:format("Compiling ~s into ~s", [Version,OutDir]),
+ io:format("~ts", [code:which(compile)]),
+ io:format("Compiling ~s into ~ts", [Version,OutDir]),
Opts = [report,
bin_opt_info,
{outdir,OutDir},
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 17983e972d..95fc5e398c 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -653,7 +653,7 @@ clash(Config) when is_list(Config) ->
DDir = ?config(data_dir,Config)++"clash/",
P = code:get_path(),
[TestServerPath|_] = [Path || Path <- code:get_path(),
- re:run(Path,"test_server/?$",[]) /= nomatch],
+ re:run(Path,"test_server/?$",[unicode]) /= nomatch],
%% test non-clashing entries
@@ -1527,7 +1527,10 @@ create_big_script(Config,Local) ->
Leftover <- UnloadFix,
lists:keymember(Leftover,1,InitialApplications) ],
%% Now we should have only "real" applications...
- [application:load(list_to_atom(Y)) || {match,[Y]} <- [ re:run(X,code:lib_dir()++"/"++"([^/-]*).*/ebin",[{capture,[1],list}]) || X <- code:get_path()],filter_app(Y,Local)],
+ [application:load(list_to_atom(Y))
+ || {match,[Y]} <- [ re:run(X,code:lib_dir()++"/"++"([^/-]*).*/ebin",
+ [{capture,[1],list, unicode}]) ||
+ X <- code:get_path()],filter_app(Y,Local)],
Apps = [ {N,V} || {N,_,V} <- application:loaded_applications()],
{ok,Fd} = file:open(Name ++ ".rel", [write]),
io:format(Fd,
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index 233ba0764f..692dfe0faa 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -146,7 +146,7 @@ start_restricted_from_shell(Config) when is_list(Config) ->
"test_restricted) end.">>),
?line {ok, test_restricted} =
application:get_env(stdlib, restricted_shell),
- ?line "Module" ++ _ = t(<<"begin m() end.">>),
+ ?line "Module" ++ _ = t({<<"begin m() end.">>, utf8}),
?line "exception exit: restricted shell does not allow c(foo)" =
comm_err(<<"begin c(foo) end.">>),
?line "exception exit: restricted shell does not allow init:stop()" =
@@ -225,7 +225,7 @@ start_restricted_on_command_line(Config) when is_list(Config) ->
?line {ok,Node2} = start_node(shell_suite_helper_2,
"-pa "++?config(priv_dir,Config)++
" -stdlib restricted_shell test_restricted2"),
- ?line "Module" ++ _ = t({Node2,<<"begin m() end.">>}),
+ ?line "Module" ++ _ = t({Node2,<<"begin m() end.">>, utf8}),
?line "exception exit: restricted shell does not allow c(foo)" =
comm_err({Node2,<<"begin c(foo) end.">>}),
?line "exception exit: restricted shell does not allow init:stop()" =
@@ -2927,14 +2927,14 @@ t1(Parent, {Bin,Enc}, F) ->
server_loop(S)
catch exit:R -> Parent ! {self(), R};
throw:{?MODULE,LoopReply,latin1} ->
- L0 = binary_to_list(list_to_binary(LoopReply)),
- [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
- Parent ! {self(), dotify(L1)};
+ L0 = binary_to_list(list_to_binary(LoopReply)),
+ [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
+ Parent ! {self(), dotify(L1)};
throw:{?MODULE,LoopReply,_Uni} ->
- Tmp = unicode:characters_to_binary(LoopReply),
- L0 = unicode:characters_to_list(Tmp),
- [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
- Parent ! {self(), dotify(L1)}
+ Tmp = unicode:characters_to_binary(LoopReply),
+ L0 = unicode:characters_to_list(Tmp),
+ [$\n | L1] = lists:dropwhile(fun(X) -> X =/= $\n end, L0),
+ Parent ! {self(), dotify(L1)}
after group_leader(S#state.leader, self())
end.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index fd381f0b25..0d8ed377bb 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -73,7 +73,7 @@ print_error_markers(F, File) ->
case erl_syntax:type(F) of
error_marker ->
{L,M,Info} = erl_syntax:error_marker_info(F),
- io:format("~s:~p: ~s", [File,L,M:format_error(Info)]);
+ io:format("~ts:~p: ~s", [File,L,M:format_error(Info)]);
_ ->
ok
end.