aboutsummaryrefslogtreecommitdiff
path: root/test/float_test.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'test/float_test.gleam')
-rw-r--r--test/float_test.gleam28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/float_test.gleam b/test/float_test.gleam
index 161f6df..54f1463 100644
--- a/test/float_test.gleam
+++ b/test/float_test.gleam
@@ -36,3 +36,31 @@ pub fn to_string_test() {
|> 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)
+}