aboutsummaryrefslogtreecommitdiff
path: root/gen/test/gleam@atom_test.erl
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-06-25 22:48:07 +0100
committerLouis Pilfold <louis@lpil.uk>2019-06-25 22:48:07 +0100
commit2c2541750ca4b7b604070c75c18d84be833c97d5 (patch)
treef5e63d941a1c7e2c2d4dff1d81c43fa2766308ae /gen/test/gleam@atom_test.erl
parent96c20b8ebf8420fbba75c97fa08eaeb34e8dc394 (diff)
downloadgleam_stdlib-2c2541750ca4b7b604070c75c18d84be833c97d5.tar.gz
gleam_stdlib-2c2541750ca4b7b604070c75c18d84be833c97d5.zip
stdlib namespace std -> gleam
Diffstat (limited to 'gen/test/gleam@atom_test.erl')
-rw-r--r--gen/test/gleam@atom_test.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/gen/test/gleam@atom_test.erl b/gen/test/gleam@atom_test.erl
new file mode 100644
index 0000000..d9c429c
--- /dev/null
+++ b/gen/test/gleam@atom_test.erl
@@ -0,0 +1,24 @@
+-module(gleam@atom_test).
+-compile(no_auto_import).
+
+-export([from_string_test/0, create_from_string_test/0, to_string_test/0]).
+
+from_string_test() ->
+ gleam@expect:is_ok(gleam@atom:from_string(<<"ok">>)),
+ gleam@expect:is_ok(gleam@atom:from_string(<<"expect">>)),
+ gleam@expect:is_error(gleam@atom:from_string(<<"this is not an atom we have seen before">>)).
+
+create_from_string_test() ->
+ gleam@expect:equal({ok, gleam@atom:create_from_string(<<"ok">>)},
+ gleam@atom:from_string(<<"ok">>)),
+ gleam@expect:equal({ok, gleam@atom:create_from_string(<<"expect">>)},
+ gleam@atom:from_string(<<"expect">>)),
+ gleam@expect:equal({ok,
+ gleam@atom:create_from_string(<<"this is another atom we have not seen before">>)},
+ gleam@atom:from_string(<<"this is another atom we have not seen before">>)).
+
+to_string_test() ->
+ gleam@expect:equal(gleam@atom:to_string(gleam@atom:create_from_string(<<"ok">>)),
+ <<"ok">>),
+ gleam@expect:equal(gleam@atom:to_string(gleam@atom:create_from_string(<<"expect">>)),
+ <<"expect">>).