diff options
author | Magnus Lång <[email protected]> | 2014-03-26 18:58:46 +0100 |
---|---|---|
committer | Kostis Sagonas <[email protected]> | 2014-04-29 11:40:29 +0200 |
commit | 5a43eb383bdeb604fd8a891ffe34610c3fe6208b (patch) | |
tree | 1a76c9a5bf0d8f32c06acb8266eaa52ce6e860d5 /lib/hipe/test/maps_SUITE_data/maps_guard_update.erl | |
parent | e486d8b0c6124f39db6fa600f348c7bd5c0c1a13 (diff) | |
download | otp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.tar.gz otp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.tar.bz2 otp-5a43eb383bdeb604fd8a891ffe34610c3fe6208b.zip |
Copy the tests for maps from the compiler application to a new HiPE test suite
Change the maps_guard_fun test to accept the HiPE trace format.
Diffstat (limited to 'lib/hipe/test/maps_SUITE_data/maps_guard_update.erl')
-rw-r--r-- | lib/hipe/test/maps_SUITE_data/maps_guard_update.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hipe/test/maps_SUITE_data/maps_guard_update.erl b/lib/hipe/test/maps_SUITE_data/maps_guard_update.erl new file mode 100644 index 0000000000..254c1c2984 --- /dev/null +++ b/lib/hipe/test/maps_SUITE_data/maps_guard_update.erl @@ -0,0 +1,14 @@ +-module(maps_guard_update). +-export([test/0]). + +test() -> + error = map_guard_update(#{},#{}), + first = map_guard_update(#{}, #{x=>first}), + second = map_guard_update(#{y=>old}, #{x=>second,y=>old}), + third = map_guard_update(#{x=>old,y=>old}, #{x=>third,y=>old}), + ok. + +map_guard_update(M1, M2) when M1#{x=>first} =:= M2 -> first; +map_guard_update(M1, M2) when M1#{x=>second} =:= M2 -> second; +map_guard_update(M1, M2) when M1#{x:=third} =:= M2 -> third; +map_guard_update(_, _) -> error. |