diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-10-28 15:08:05 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-10-28 15:08:05 +0100 |
commit | 6e30d2a47c2a2bded04b2a411161147cba7aca51 (patch) | |
tree | a9a6b59b2807b25277e4b8323987b2c7d30e08c2 /erts/emulator/test/match_spec_SUITE.erl | |
parent | b1c1a40410c62273dd00e9ca1e29cf3056d41b67 (diff) | |
parent | a2ffd6fd0e7f693847450aa633f7a4a18f9baead (diff) | |
download | otp-6e30d2a47c2a2bded04b2a411161147cba7aca51.tar.gz otp-6e30d2a47c2a2bded04b2a411161147cba7aca51.tar.bz2 otp-6e30d2a47c2a2bded04b2a411161147cba7aca51.zip |
Merge branch 'egil/nox/maps-match_specs/OTP-12270'
* egil/nox/maps-match_specs/OTP-12270:
erts: Fix return value from erts_maps_get to be const
Properly support maps in match_specs
Support maps in ms_transform
Return pointer to value in erts_maps_get()
Diffstat (limited to 'erts/emulator/test/match_spec_SUITE.erl')
-rw-r--r-- | erts/emulator/test/match_spec_SUITE.erl | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/erts/emulator/test/match_spec_SUITE.erl b/erts/emulator/test/match_spec_SUITE.erl index fdce157abc..fc4a5028e1 100644 --- a/erts/emulator/test/match_spec_SUITE.erl +++ b/erts/emulator/test/match_spec_SUITE.erl @@ -30,6 +30,7 @@ -export([fpe/1]). -export([otp_9422/1]). -export([faulty_seq_trace/1, do_faulty_seq_trace/0]). +-export([maps/1]). -export([runner/2, loop_runner/3]). -export([f1/1, f2/2, f3/2, fn/1, fn/2, fn/3]). -export([do_boxed_and_small/0]). @@ -62,7 +63,8 @@ all() -> moving_labels, faulty_seq_trace, empty_list, - otp_9422]; + otp_9422, + maps]; true -> [not_run] end. @@ -899,6 +901,31 @@ fpe(Config) when is_list(Config) -> _ -> ok end. +maps(Config) when is_list(Config) -> + {ok,#{},[],[]} = erlang:match_spec_test(#{}, [{'_',[],['$_']}], table), + {ok,#{},[],[]} = erlang:match_spec_test(#{}, [{#{},[],['$_']}], table), + {ok,false,[],[]} = + erlang:match_spec_test(#{}, [{not_a_map,[],['$_']}], table), + {ok,bar,[],[]} = + erlang:match_spec_test(#{foo => bar}, + [{#{foo => '$1'},[],['$1']}], + table), + {ok,false,[],[]} = + erlang:match_spec_test(#{foo => bar}, + [{#{foo => qux},[],[qux]}], + table), + {ok,false,[],[]} = + erlang:match_spec_test(#{}, [{#{foo => '_'},[],[foo]}], table), + {error,_} = + erlang:match_spec_test(#{}, [{#{'$1' => '_'},[],[foo]}], table), + {ok,bar,[],[]} = + erlang:match_spec_test({#{foo => bar}}, + [{{#{foo => '$1'}},[],['$1']}], + table), + {ok,#{foo := 3},[],[]} = + erlang:match_spec_test({}, [{{},[],[#{foo => {'+',1,2}}]}], table), + ok. + empty_list(Config) when is_list(Config) -> Val=[{'$1',[], [{message,'$1'},{message,{caller}},{return_trace}]}], %% Did crash debug VM in faulty assert: |