From 5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Wed, 29 May 2019 21:02:55 +0100 Subject: Enable namespaced modules --- gen/test/std@atom_test.erl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gen/test/std@atom_test.erl (limited to 'gen/test/std@atom_test.erl') diff --git a/gen/test/std@atom_test.erl b/gen/test/std@atom_test.erl new file mode 100644 index 0000000..20629d9 --- /dev/null +++ b/gen/test/std@atom_test.erl @@ -0,0 +1,24 @@ +-module(std@atom_test). +-compile(no_auto_import). + +-export([from_string_test/0, create_from_string_test/0, to_string_test/0]). + +from_string_test() -> + std@expect:is_ok(std@atom:from_string(<<"ok">>)), + std@expect:is_ok(std@atom:from_string(<<"expect">>)), + std@expect:is_error(std@atom:from_string(<<"this is not an atom we have seen before">>)). + +create_from_string_test() -> + std@expect:equal({ok, std@atom:create_from_string(<<"ok">>)}, + std@atom:from_string(<<"ok">>)), + std@expect:equal({ok, std@atom:create_from_string(<<"expect">>)}, + std@atom:from_string(<<"expect">>)), + std@expect:equal({ok, + std@atom:create_from_string(<<"this is another atom we have not seen before">>)}, + std@atom:from_string(<<"this is another atom we have not seen before">>)). + +to_string_test() -> + std@expect:equal(std@atom:to_string(std@atom:create_from_string(<<"ok">>)), + <<"ok">>), + std@expect:equal(std@atom:to_string(std@atom:create_from_string(<<"expect">>)), + <<"expect">>). -- cgit v1.2.3