aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/map_SUITE.erl33
1 files changed, 18 insertions, 15 deletions
diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl
index ea3483d09e..69b68c4b67 100644
--- a/erts/emulator/test/map_SUITE.erl
+++ b/erts/emulator/test/map_SUITE.erl
@@ -806,14 +806,17 @@ t_ets(_Config) ->
[] = ets:select(Tid,[{{'$1','_'},[{'==','$1',#{ b => c }}],['$_']}]),
%% Test match with map of different size
- [{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
+ %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
- %% Test match with don't care value
- [{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
+ %%% Test match with don't care value
+ %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
%% Test is_map bif
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
ets:insert(Tid,{not_a_map,2}),
- 100 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$_']}])),
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
+ ets:insert(Tid,{{nope,a,tuple},2}),
+ 101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
%% Test map_size bif
[3] = ets:select(Tid,[{{'$1','_'},[{'==',{map_size,'$1'},3}],
@@ -857,18 +860,22 @@ t_tracing(_Config) ->
{trace,_,call,{?MODULE,id,[#{ b := c }]}} = getmsg(Tracer),
dbg:ctpl(),
- %% Test map guard bifs
- {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{'or',{is_map,{element,1,'$1'}},
- {'==',{map_size,'$1'},2}}],[]}]),
+ % Test map guard bifs
+ {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{is_map,{element,1,'$1'}}],[]}]),
id(#{ a => b }),
id({1,2}),
id({#{ a => b},2}),
- id(#{ a => b, b => c}),
{trace,_,call,{?MODULE,id,[{#{ a := b },2}]}} = getmsg(Tracer),
- {trace,_,call,{?MODULE,id,[#{ a := b, b := c }]}} = getmsg(Tracer),
dbg:ctpl(),
- %% Test fun2ms, DOES NOT COMPILE!!
+ {ok,_} = dbg:tpl(?MODULE,id,[{['$1'],[{'==',{map_size,{element,1,'$1'}},2}],[]}]),
+ id(#{ a => b }),
+ id({1,2}),
+ id({#{ a => b},2}),
+ id({#{ a => b, b => c},atom}),
+ {trace,_,call,{?MODULE,id,[{#{ a := b, b := c },atom}]}} = getmsg(Tracer),
+ dbg:ctpl(),
+
%MS = dbg:fun2ms(fun([A]) when A == #{ a => b} -> ok end),
%dbg:tpl(?MODULE,id,MS),
%id(#{ a => b }),
@@ -883,11 +890,7 @@ t_tracing(_Config) ->
ok.
getmsg(_Tracer) ->
- receive
- V -> V
- after 50 ->
- timeout
- end.
+ receive V -> V after 100 -> timeout end.
trace_collector(Msg,Parent) ->
io:format("~p~n",[Msg]),