aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/float_test.gleam26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/float_test.gleam b/test/float_test.gleam
index 54f1463..a3bf4c1 100644
--- a/test/float_test.gleam
+++ b/test/float_test.gleam
@@ -64,3 +64,29 @@ pub fn floor_test() {
|> 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)
+}