Current section

Files

Jump to
given src given@internal@examples.erl
Raw

src/given@internal@examples.erl

-module(given@internal@examples).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([given_example/0, not_given_example/0, given_ok_in_example/0, given_error_in_example/0, given_some_in_example/0, given_none_in_example/0, main/0]).
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 14).
-spec given_example() -> nil.
given_example() ->
_pipe = begin
User_understood = false,
given:given(
User_understood,
fun() -> <<"πŸ’‘ Bright!"/utf8>> end,
fun() -> <<"🀯 Woof!"/utf8>> end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 27).
-spec not_given_example() -> nil.
not_given_example() ->
_pipe = begin
Has_admin_role = true,
given:not_given(
Has_admin_role,
fun() -> <<"βœ‹ Denied!"/utf8>> end,
fun() -> <<"πŸ‘Œ Access granted..."/utf8>> end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 41).
-spec given_ok_in_example() -> nil.
given_ok_in_example() ->
_pipe = begin
Result = {ok, <<"Hello Joe!"/utf8>>},
given:ok_in(
Result,
fun(Error_value) -> Error_value end,
fun(Ok_value) -> Ok_value end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 56).
-spec given_error_in_example() -> nil.
given_error_in_example() ->
_pipe = begin
Result = {error, <<"Memory exceeded!"/utf8>>},
given:error_in(
Result,
fun(Ok_value) -> Ok_value end,
fun(Error_value) -> Error_value end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 71).
-spec given_some_in_example() -> nil.
given_some_in_example() ->
_pipe = begin
Option = {some, <<"One Penny"/utf8>>},
given:some_in(
Option,
fun() -> <<"Woof!"/utf8>> end,
fun(Some_value) -> Some_value end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 84).
-spec given_none_in_example() -> nil.
given_none_in_example() ->
_pipe = begin
Option = none,
given:none_in(
Option,
fun(Some_value) -> Some_value end,
fun() -> <<"Nothing at all"/utf8>> end
)
end,
gleam@io:debug(_pipe),
nil.
-file("/Users/leo/Documents/together/toyland/new/lib_given/src/given/internal/examples.gleam", 5).
-spec main() -> nil.
main() ->
given_example(),
not_given_example(),
given_ok_in_example(),
given_error_in_example(),
given_some_in_example(),
given_none_in_example().