aboutsummaryrefslogtreecommitdiff
path: root/gen/bool.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-03-10 20:07:37 +0000
committerLouis Pilfold <louis@lpil.uk>2019-03-10 20:07:37 +0000
commit2a7d9061e4ec9c763053b078db2d98400bd08dd5 (patch)
treea6f36c30dc08db6a85cd1dad4b99031380e81832 /gen/bool.erl
parentd74af16e6a527f46730c3d35554ef55677c9caf4 (diff)
downloadgleam_stdlib-2a7d9061e4ec9c763053b078db2d98400bd08dd5.tar.gz
gleam_stdlib-2a7d9061e4ec9c763053b078db2d98400bd08dd5.zip
Surround Fn's in parens if called directly
Closes https://github.com/lpil/gleam/issues/88
Diffstat (limited to 'gen/bool.erl')
-rw-r--r--gen/bool.erl20
1 files changed, 10 insertions, 10 deletions
diff --git a/gen/bool.erl b/gen/bool.erl
index 52a9379..9024a16 100644
--- a/gen/bool.erl
+++ b/gen/bool.erl
@@ -14,10 +14,10 @@ max(A, B) ->
-ifdef(TEST).
max_test() ->
- _ = fun(Capture1) -> expect:equal(Capture1, true) end(max(true, true)),
- _ = fun(Capture1) -> expect:equal(Capture1, true) end(max(true, false)),
- _ = fun(Capture1) -> expect:equal(Capture1, false) end(max(false, false)),
- fun(Capture1) -> expect:equal(Capture1, true) end(max(false, true)).
+ _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, true)),
+ _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, false)),
+ _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(max(false, false)),
+ (fun(Capture1) -> expect:equal(Capture1, true) end)(max(false, true)).
-endif.
min(A, B) ->
@@ -31,10 +31,10 @@ min(A, B) ->
-ifdef(TEST).
min_test() ->
- _ = fun(Capture1) -> expect:equal(Capture1, true) end(min(true, true)),
- _ = fun(Capture1) -> expect:equal(Capture1, false) end(min(true, false)),
- _ = fun(Capture1) -> expect:equal(Capture1, false) end(min(false, false)),
- fun(Capture1) -> expect:equal(Capture1, false) end(min(false, true)).
+ _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(min(true, true)),
+ _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(min(true, false)),
+ _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(min(false, false)),
+ (fun(Capture1) -> expect:equal(Capture1, false) end)(min(false, true)).
-endif.
to_int(Bool) ->
@@ -48,6 +48,6 @@ to_int(Bool) ->
-ifdef(TEST).
to_int_test() ->
- _ = fun(Capture1) -> expect:equal(Capture1, 1) end(to_int(true)),
- fun(Capture1) -> expect:equal(Capture1, 0) end(to_int(false)).
+ _ = (fun(Capture1) -> expect:equal(Capture1, 1) end)(to_int(true)),
+ (fun(Capture1) -> expect:equal(Capture1, 0) end)(to_int(false)).
-endif.