aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2016-03-31 08:58:44 +0200
committerHans Bolinder <[email protected]>2016-04-21 12:38:46 +0200
commit398b7cb10fdf21c98514697d70f01e8ca7f1aad7 (patch)
tree0920e7535f80e70a055d0523270d97206c8966d7 /lib/stdlib
parentf2cef11a16d8d5f643cdf913b46042db71bff867 (diff)
downloadotp-398b7cb10fdf21c98514697d70f01e8ca7f1aad7.tar.gz
otp-398b7cb10fdf21c98514697d70f01e8ca7f1aad7.tar.bz2
otp-398b7cb10fdf21c98514697d70f01e8ca7f1aad7.zip
Make assert macro implementations uniform
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/include/assert.hrl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/stdlib/include/assert.hrl b/lib/stdlib/include/assert.hrl
index 151794d114..74fdbf57aa 100644
--- a/lib/stdlib/include/assert.hrl
+++ b/lib/stdlib/include/assert.hrl
@@ -149,7 +149,8 @@
-else.
-define(assertEqual(Expect, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Expect),
case (Expr) of
__X -> ok;
__V -> erlang:error({assertEqual,
@@ -159,7 +160,7 @@
{expected, __X},
{value, __V}]})
end
- end)(Expect))
+ end)())
end).
-endif.
@@ -169,7 +170,8 @@
-else.
-define(assertNotEqual(Unexpected, Expr),
begin
- ((fun (__X) ->
+ ((fun () ->
+ __X = (Unexpected),
case (Expr) of
__X -> erlang:error({assertNotEqual,
[{module, ?MODULE},
@@ -178,7 +180,7 @@
{value, __X}]});
_ -> ok
end
- end)(Unexpected))
+ end)())
end).
-endif.