aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-10-23 19:49:12 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-10-24 18:00:13 +0200
commitac264cba1435bf84eecc6b31809bd996c4c8e9c0 (patch)
treefe29e4630d2febd7557cdc25b877b6cc78fe361c /lib/syntax_tools/test
parent58d64b9bd9a5759451f678e8a1dcf36b8ded19fd (diff)
downloadotp-ac264cba1435bf84eecc6b31809bd996c4c8e9c0.tar.gz
otp-ac264cba1435bf84eecc6b31809bd996c4c8e9c0.tar.bz2
otp-ac264cba1435bf84eecc6b31809bd996c4c8e9c0.zip
syntax_tools: Teach Maps to erl_syntax
Affected functions: * erl_syntax:abstract/1 * erl_syntax:concrete/1 * erl_syntax:is_leaf/1 * erl_syntax:is_literal/1
Diffstat (limited to 'lib/syntax_tools/test')
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index b4141956e6..721d1fd87c 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -136,6 +136,8 @@ t_abstract_type(Config) when is_list(Config) ->
{[$a,$b,$c],string},
{"hello world",string},
{<<1,2,3>>,binary},
+ {#{a=>1,"b"=>2},map_expr},
+ {#{#{i=>1}=>1,"b"=>#{v=>2}},map_expr},
{{a,b,c},tuple}]),
ok.
@@ -152,6 +154,7 @@ t_erl_parse_type(Config) when is_list(Config) ->
{"_", underscore,true},
{"[]", nil,true},
{"{}", tuple,true},
+ {"#{}",map_expr,true},
{"'some atom'", atom, true}]),
%% composite types
ok = validate(F,[{"case X of t -> t; f -> f end", case_expr,false},
@@ -175,6 +178,7 @@ t_erl_parse_type(Config) when is_list(Config) ->
{"[<<1>>,<<2>>,-2,<<>>,[more,list]]", list,false},
{"[1|[2|[3|[4|[]]]]]", list,false},
{"#{ a=>1, b=>2 }", map_expr,false},
+ {"#{3=>3}#{ a=>1, b=>2 }", map_expr,false},
{"#{ a:=1, b:=2 }", map_expr,false},
{"M#{ a=>1, b=>2 }", map_expr,false},
{"[V||V <- Vs]", list_comp,false},