aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/andor_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/test/andor_SUITE.erl')
-rw-r--r--lib/compiler/test/andor_SUITE.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl
index 7bef0aa27c..b5408ecd8f 100644
--- a/lib/compiler/test/andor_SUITE.erl
+++ b/lib/compiler/test/andor_SUITE.erl
@@ -129,6 +129,10 @@ t_case_y(X, Y, Z) ->
Y =:= 100
end.
+-define(GUARD(E), if E -> true;
+ true -> false
+ end).
+
t_and_or(Config) when is_list(Config) ->
?line true = true and true,
?line false = true and false,
@@ -160,11 +164,16 @@ t_and_or(Config) when is_list(Config) ->
?line true = false or id(true),
?line false = false or id(false),
- ok.
+ True = id(true),
--define(GUARD(E), if E -> true;
- true -> false
- end).
+ false = ?GUARD(erlang:'and'(bar, True)),
+ false = ?GUARD(erlang:'or'(bar, True)),
+ false = ?GUARD(erlang:'not'(erlang:'and'(bar, True))),
+ false = ?GUARD(erlang:'not'(erlang:'not'(erlang:'and'(bar, True)))),
+
+ true = (fun (X = true) when X or true or X -> true end)(True),
+
+ ok.
t_andalso(Config) when is_list(Config) ->
Bs = [true,false],