From 2c2541750ca4b7b604070c75c18d84be833c97d5 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 25 Jun 2019 22:48:07 +0100 Subject: stdlib namespace std -> gleam --- test/std/float_test.gleam | 118 ---------------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 test/std/float_test.gleam (limited to 'test/std/float_test.gleam') diff --git a/test/std/float_test.gleam b/test/std/float_test.gleam deleted file mode 100644 index 0847973..0000000 --- a/test/std/float_test.gleam +++ /dev/null @@ -1,118 +0,0 @@ -import std/expect -import std/float - -pub fn parse_test() { - "1.23" - |> float:parse - |> expect:equal(_, Ok(1.23)) - - "5.0" - |> float:parse - |> expect:equal(_, Ok(5.0)) - - "0.123456789" - |> float:parse - |> expect:equal(_, Ok(0.123456789)) - - "" - |> float:parse - |> expect:is_error - - "what" - |> float:parse - |> expect:is_error - - "1" - |> float:parse - |> expect:is_error -} - -pub fn to_string_test() { - 123.0 - |> float:to_string - |> expect:equal(_, "123.0") - - -8.1 - |> float:to_string - |> expect:equal(_, "-8.1") -} - -pub fn ceiling_test() { - 8.1 - |> float:ceiling - |> expect:equal(_, 9.0) - - -8.1 - |> float:ceiling - |> expect:equal(_, -8.0) - - -8.0 - |> float:ceiling - |> expect:equal(_, -8.0) -} - -pub fn floor_test() { - 8.1 - |> float:floor - |> expect:equal(_, 8.0) - - -8.1 - |> float:floor - |> expect:equal(_, -9.0) - - -8.0 - |> float:floor - |> expect:equal(_, -8.0) -} - -pub fn round_test() { - 8.1 - |> float:round - |> expect:equal(_, 8) - - 8.4 - |> float:round - |> expect:equal(_, 8) - - 8.499 - |> float:round - |> expect:equal(_, 8) - - 8.5 - |> float:round - |> expect:equal(_, 9) - - -8.1 - |> float:round - |> expect:equal(_, -8) - - -7.5 - |> float:round - |> expect:equal(_, -8) -} - -pub fn truncate_test() { - 8.1 - |> float:truncate - |> expect:equal(_, 8) - - 8.4 - |> float:truncate - |> expect:equal(_, 8) - - 8.499 - |> float:truncate - |> expect:equal(_, 8) - - 8.5 - |> float:truncate - |> expect:equal(_, 8) - - -8.1 - |> float:truncate - |> expect:equal(_, -8) - - -7.5 - |> float:truncate - |> expect:equal(_, -7) -} -- cgit v1.2.3