diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-04-24 23:36:29 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-04-24 23:36:29 +0100 |
commit | b688779c0859ef9da2569bc77475457786fdc490 (patch) | |
tree | ff9910f036486f79424254ce0c0b0e8916056b62 /gen/test/gleam@function_test.erl | |
parent | 6b34f8b616d4ec169ebf8d1e5a26d78ceebc8a59 (diff) | |
download | gleam_stdlib-b688779c0859ef9da2569bc77475457786fdc490.tar.gz gleam_stdlib-b688779c0859ef9da2569bc77475457786fdc490.zip |
Initial map documentation
Diffstat (limited to 'gen/test/gleam@function_test.erl')
-rw-r--r-- | gen/test/gleam@function_test.erl | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gen/test/gleam@function_test.erl b/gen/test/gleam@function_test.erl index ecac21f..d85bce1 100644 --- a/gen/test/gleam@function_test.erl +++ b/gen/test/gleam@function_test.erl @@ -11,35 +11,40 @@ compose_test() -> HeadToString = gleam@function:compose( gleam@function:compose( fun gleam@list:head/1, - fun(Capture1) -> gleam@result:unwrap(Capture1, 0) end + fun(GleamCaptureVariable) -> + gleam@result:unwrap(GleamCaptureVariable, 0) + end ), fun gleam@int:to_string/1 ), - gleam@should:equal(HeadToString([1]), <<"1">>), - gleam@should:equal(HeadToString([]), <<"0">>). + 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: '">>, S), - <<"', Int: '">> + 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">>, 1), <<"String: 'Bob', Int: '1'">>), gleam@should:equal( - FlippedFun(2, <<"Alice">>), - <<"String: 'Alice', Int: '2'">> + 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(<<"">>), <<"">>), + 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}). |