aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/edlin_expand_SUITE.erl
diff options
context:
space:
mode:
authorPierre Fenoll <[email protected]>2013-12-03 12:55:38 +0000
committerPierre Fenoll <[email protected]>2014-01-09 12:38:49 +0000
commitdfb4ec804a099b539c91e5643090d8183885e71c (patch)
treeadb553973587895787ead759ea6efa7fc413d1a1 /lib/stdlib/test/edlin_expand_SUITE.erl
parent2f2824519d13e7745c02efbc7c29c37a76885fee (diff)
downloadotp-dfb4ec804a099b539c91e5643090d8183885e71c.tar.gz
otp-dfb4ec804a099b539c91e5643090d8183885e71c.tar.bz2
otp-dfb4ec804a099b539c91e5643090d8183885e71c.zip
Shell: expand 0-arity functions all the way to closing parenthesis
`erl` has tab completion for modules' exported functions but expands only up to the opening paren. This commit closes that opening paren in case the function is of arity zero and there is no other function with the same name. It browses the lists of matches (a 2nd time) for Arity, on complete match and then decides what to append.
Diffstat (limited to 'lib/stdlib/test/edlin_expand_SUITE.erl')
-rw-r--r--lib/stdlib/test/edlin_expand_SUITE.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl
index 0cd2688e2e..2c1c5acf5a 100644
--- a/lib/stdlib/test/edlin_expand_SUITE.erl
+++ b/lib/stdlib/test/edlin_expand_SUITE.erl
@@ -76,11 +76,14 @@ normal(Config) when is_list(Config) ->
[{"a_fun_name",1},
{"a_less_fun_name",1},
{"b_comes_after_a",1},
+ {"expand0arity_entirely",0},
{"module_info",0},
{"module_info",1}]} = edlin_expand:expand(lists:reverse("expand_test:")),
?line {yes,[],[{"a_fun_name",1},
{"a_less_fun_name",1}]} = edlin_expand:expand(
lists:reverse("expand_test:a_")),
+ ?line {yes,"arity_entirely()",[]} = edlin_expand:expand(
+ lists:reverse("expand_test:expand0")),
ok.
quoted_fun(doc) ->
@@ -93,7 +96,7 @@ quoted_fun(Config) when is_list(Config) ->
%% should be no colon after test this time
?line {yes, "test", []} = edlin_expand:expand(lists:reverse("expand_")),
?line {no, [], []} = edlin_expand:expand(lists:reverse("expandXX_")),
- ?line {no,[],[{"'#weird-fun-name'",0},
+ ?line {no,[],[{"'#weird-fun-name'",1},
{"'Quoted_fun_name'",0},
{"'Quoted_fun_too'",0},
{"a_fun_name",1},
@@ -108,7 +111,7 @@ quoted_fun(Config) when is_list(Config) ->
{"a_less_fun_name",1}]} = edlin_expand:expand(
lists:reverse("expand_test1:a_")),
?line {yes,[],
- [{"'#weird-fun-name'",0},
+ [{"'#weird-fun-name'",1},
{"'Quoted_fun_name'",0},
{"'Quoted_fun_too'",0}]} = edlin_expand:expand(
lists:reverse("expand_test1:'")),
@@ -172,6 +175,6 @@ quoted_both(Config) when is_list(Config) ->
[{"'Quoted_fun_name'",0},
{"'Quoted_fun_too'",0}]} = edlin_expand:expand(
lists:reverse("'ExpandTestCaps1':'Quoted_fun_")),
- ?line {yes,"weird-fun-name'(",[]} = edlin_expand:expand(
- lists:reverse("'ExpandTestCaps1':'#")),
+ ?line {yes,"weird-fun-name'()",[]} = edlin_expand:expand(
+ lists:reverse("'ExpandTestCaps1':'#")),
ok.