diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:33:15 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-04-22 22:33:15 +0000 |
commit | 077aaf3468c640b84ff53fc92171292ddae55bf4 (patch) | |
tree | a152edcc2240f053681ca6ba315dfeb9ed8fa793 /gen/test/float_test.erl | |
parent | afdabad5cd2df77eb3f309aab9da3d34e36a0b49 (diff) | |
download | gleam_stdlib-077aaf3468c640b84ff53fc92171292ddae55bf4.tar.gz gleam_stdlib-077aaf3468c640b84ff53fc92171292ddae55bf4.zip |
Int and float modules
Diffstat (limited to 'gen/test/float_test.erl')
-rw-r--r-- | gen/test/float_test.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gen/test/float_test.erl b/gen/test/float_test.erl new file mode 100644 index 0000000..642e5ed --- /dev/null +++ b/gen/test/float_test.erl @@ -0,0 +1,16 @@ +-module(float_test). +-compile(no_auto_import). + +-export([parse_test/0, to_string_test/0]). + +parse_test() -> + expect:equal(float:parse(<<"1.23">>), {ok, 1.23}), + expect:equal(float:parse(<<"5.0">>), {ok, 5.0}), + expect:equal(float:parse(<<"0.123456789">>), {ok, 0.123456789}), + expect:is_error(float:parse(<<"">>)), + expect:is_error(float:parse(<<"what">>)), + expect:is_error(float:parse(<<"1">>)). + +to_string_test() -> + expect:equal(float:to_string(123.0), <<"123.0">>), + expect:equal(float:to_string(-8.1), <<"-8.1">>). |