aboutsummaryrefslogtreecommitdiff
path: root/gen/test/gleam@function_test.erl
diff options
context:
space:
mode:
authorPeter Saxton <peterhsaxton@gmail.com>2020-05-19 17:23:11 +0100
committerGitHub <noreply@github.com>2020-05-19 17:23:11 +0100
commita805e1fcdc2393aa789ef2dfb15a00669e3e079b (patch)
treecbad9cee5c94fcbbbf797869ed05d80107349c68 /gen/test/gleam@function_test.erl
parent88ab320ab452d3151f4f4b391dafd57af07e863c (diff)
downloadgleam_stdlib-a805e1fcdc2393aa789ef2dfb15a00669e3e079b.tar.gz
gleam_stdlib-a805e1fcdc2393aa789ef2dfb15a00669e3e079b.zip
Add gen to ignored files in git (#47)
Diffstat (limited to 'gen/test/gleam@function_test.erl')
-rw-r--r--gen/test/gleam@function_test.erl50
1 files changed, 0 insertions, 50 deletions
diff --git a/gen/test/gleam@function_test.erl b/gen/test/gleam@function_test.erl
deleted file mode 100644
index d85bce1..0000000
--- a/gen/test/gleam@function_test.erl
+++ /dev/null
@@ -1,50 +0,0 @@
--module(gleam@function_test).
--compile(no_auto_import).
-
--export([compose_test/0, flip_test/0, identity_test/0]).
-
-compose_test() ->
- AddTwo = fun(Int) -> Int + 2 end,
- AddThree = fun(Int1) -> Int1 + 3 end,
- AddFive = gleam@function:compose(AddTwo, AddThree),
- gleam@should:equal(AddFive(1), 6),
- HeadToString = gleam@function:compose(
- gleam@function:compose(
- fun gleam@list:head/1,
- fun(GleamCaptureVariable) ->
- gleam@result:unwrap(GleamCaptureVariable, 0)
- end
- ),
- fun gleam@int:to_string/1
- ),
- gleam@should:equal(HeadToString([1]), <<"1"/utf8>>),
- gleam@should:equal(HeadToString([]), <<"0"/utf8>>).
-
-flip_test() ->
- Fun = fun(S, I) ->
- gleam@string:append(
- gleam@string:append(
- gleam@string:append(
- gleam@string:append(<<"String: '"/utf8>>, S),
- <<"', Int: '"/utf8>>
- ),
- gleam@int:to_string(I)
- ),
- <<"'"/utf8>>
- )
- end,
- FlippedFun = gleam@function:flip(Fun),
- gleam@should:equal(
- Fun(<<"Bob"/utf8>>, 1),
- <<"String: 'Bob', Int: '1'"/utf8>>
- ),
- gleam@should:equal(
- FlippedFun(2, <<"Alice"/utf8>>),
- <<"String: 'Alice', Int: '2'"/utf8>>
- ).
-
-identity_test() ->
- gleam@should:equal(gleam@function:identity(1), 1),
- gleam@should:equal(gleam@function:identity(<<""/utf8>>), <<""/utf8>>),
- gleam@should:equal(gleam@function:identity([]), []),
- gleam@should:equal(gleam@function:identity({1, 2.0}), {1, 2.0}).