aboutsummaryrefslogtreecommitdiff
path: root/test/float_test.gleam
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-05-29 21:02:55 +0100
committerLouis Pilfold <louis@lpil.uk>2019-06-02 21:12:59 +0100
commit5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31 (patch)
tree5d0d281c66cf71c6e3ca880e6621138a71b95e7b /test/float_test.gleam
parentee03f5a0465e176e220060164a5ffc408f73ed0d (diff)
downloadgleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.tar.gz
gleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.zip
Enable namespaced modules
Diffstat (limited to 'test/float_test.gleam')
-rw-r--r--test/float_test.gleam118
1 files changed, 0 insertions, 118 deletions
diff --git a/test/float_test.gleam b/test/float_test.gleam
deleted file mode 100644
index db879b8..0000000
--- a/test/float_test.gleam
+++ /dev/null
@@ -1,118 +0,0 @@
-import expect
-import 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)
-}