aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-09-27 12:59:55 +0200
committerHans Bolinder <[email protected]>2016-09-27 12:59:55 +0200
commit65391d1365cabaf8516ad0af3ae77b9861de0349 (patch)
treeb71f14014da3020d7905de05ae8c6c23e01dd0b0
parentbe58aad8ef594f08b4cbe8da876a7977abb3ab3f (diff)
parentcf78babce57e93ad733cd51c3f4891c99aa9ee1e (diff)
downloadotp-65391d1365cabaf8516ad0af3ae77b9861de0349.tar.gz
otp-65391d1365cabaf8516ad0af3ae77b9861de0349.tar.bz2
otp-65391d1365cabaf8516ad0af3ae77b9861de0349.zip
Merge branch 'maint'
* maint: stdlib: Add a testcase for Unicode expander Support for unicode expander
-rw-r--r--lib/stdlib/src/edlin_expand.erl2
-rw-r--r--lib/stdlib/test/edlin_expand_SUITE.erl11
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl
index ec64470461..5f821caef0 100644
--- a/lib/stdlib/src/edlin_expand.erl
+++ b/lib/stdlib/src/edlin_expand.erl
@@ -118,7 +118,7 @@ format_col([A|T], Width, Len, Acc0) ->
{H1, _} -> H1;
H2 -> H2
end,
- Acc = [io_lib:format("~-*s", [Width,H]) | Acc0],
+ Acc = [io_lib:format("~-*ts", [Width,H]) | Acc0],
format_col(T, Width, Len+Width, Acc);
format_col([], _, _, Acc) ->
lists:reverse(Acc, "\n").
diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl
index ccffa2e244..718d91c6a3 100644
--- a/lib/stdlib/test/edlin_expand_SUITE.erl
+++ b/lib/stdlib/test/edlin_expand_SUITE.erl
@@ -21,7 +21,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
--export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1]).
+-export([normal/1, quoted_fun/1, quoted_module/1, quoted_both/1, erl_1152/1]).
-include_lib("common_test/include/ct.hrl").
@@ -36,7 +36,7 @@ suite() ->
{timetrap,{minutes,1}}].
all() ->
- [normal, quoted_fun, quoted_module, quoted_both].
+ [normal, quoted_fun, quoted_module, quoted_both, erl_1152].
groups() ->
[].
@@ -149,5 +149,12 @@ quoted_both(Config) when is_list(Config) ->
{yes,"weird-fun-name'()",[]} = do_expand("'ExpandTestCaps1':'#"),
ok.
+erl_1152(Config) when is_list(Config) ->
+ "\n"++"foo"++" "++[1089]++_ = do_format(["foo",[1089]]),
+ ok.
+
do_expand(String) ->
edlin_expand:expand(lists:reverse(String)).
+
+do_format(StringList) ->
+ lists:flatten(edlin_expand:format_matches(StringList)).