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 /test/str_test.gleam | |
parent | afdabad5cd2df77eb3f309aab9da3d34e36a0b49 (diff) | |
download | gleam_stdlib-077aaf3468c640b84ff53fc92171292ddae55bf4.tar.gz gleam_stdlib-077aaf3468c640b84ff53fc92171292ddae55bf4.zip |
Int and float modules
Diffstat (limited to 'test/str_test.gleam')
-rw-r--r-- | test/str_test.gleam | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/test/str_test.gleam b/test/str_test.gleam index 49e45e7..5d0d6ba 100644 --- a/test/str_test.gleam +++ b/test/str_test.gleam @@ -47,89 +47,3 @@ pub fn append_test() { str:append("Test", " Me") |> expect:equal(_, "Test Me") } - -pub fn from_int_test() { - 123 - |> str:from_int - |> expect:equal(_, "123") - - -123 - |> str:from_int - |> expect:equal(_, "-123") - - 0123 - |> str:from_int - |> expect:equal(_, "123") -} - -pub fn parse_int_test() { - "123" - |> str:parse_int - |> expect:equal(_, Ok(123)) - - "-123" - |> str:parse_int - |> expect:equal(_, Ok(-123)) - - "0123" - |> str:parse_int - |> expect:equal(_, Ok(123)) - - "" - |> str:parse_int - |> expect:is_error - - "what" - |> str:parse_int - |> expect:is_error - - "1.23" - |> str:parse_int - |> expect:is_error -} - -pub fn parse_float_test() { - "1.23" - |> str:parse_float - |> expect:equal(_, Ok(1.23)) - - "5.0" - |> str:parse_float - |> expect:equal(_, Ok(5.0)) - - "0.123456789" - |> str:parse_float - |> expect:equal(_, Ok(0.123456789)) - - "" - |> str:parse_float - |> expect:is_error - - "what" - |> str:parse_float - |> expect:is_error - - "1" - |> str:parse_float - |> expect:is_error -} - -pub fn base_from_int_test() { - 100 - |> str:base_from_int(_, 16) - |> expect:equal(_, "64") - - -100 - |> str:base_from_int(_, 16) - |> expect:equal(_, "-64") -} - -pub fn from_float_test() { - 123.0 - |> str:from_float - |> expect:equal(_, "123.0") - - -8.1 - |> str:from_float - |> expect:equal(_, "-8.1") -} |