aboutsummaryrefslogtreecommitdiff
path: root/test/std/int_test.gleam
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-06-25 22:48:07 +0100
committerLouis Pilfold <louis@lpil.uk>2019-06-25 22:48:07 +0100
commit2c2541750ca4b7b604070c75c18d84be833c97d5 (patch)
treef5e63d941a1c7e2c2d4dff1d81c43fa2766308ae /test/std/int_test.gleam
parent96c20b8ebf8420fbba75c97fa08eaeb34e8dc394 (diff)
downloadgleam_stdlib-2c2541750ca4b7b604070c75c18d84be833c97d5.tar.gz
gleam_stdlib-2c2541750ca4b7b604070c75c18d84be833c97d5.zip
stdlib namespace std -> gleam
Diffstat (limited to 'test/std/int_test.gleam')
-rw-r--r--test/std/int_test.gleam73
1 files changed, 0 insertions, 73 deletions
diff --git a/test/std/int_test.gleam b/test/std/int_test.gleam
deleted file mode 100644
index 63e9d50..0000000
--- a/test/std/int_test.gleam
+++ /dev/null
@@ -1,73 +0,0 @@
-import std/expect
-import std/int
-import std/order
-
-pub fn to_string() {
- 123
- |> int:to_string
- |> expect:equal(_, "123")
-
- -123
- |> int:to_string
- |> expect:equal(_, "-123")
-
- 0123
- |> int:to_string
- |> expect:equal(_, "123")
-}
-
-pub fn parse() {
- "123"
- |> int:parse
- |> expect:equal(_, Ok(123))
-
- "-123"
- |> int:parse
- |> expect:equal(_, Ok(-123))
-
- "0123"
- |> int:parse
- |> expect:equal(_, Ok(123))
-
- ""
- |> int:parse
- |> expect:is_error
-
- "what"
- |> int:parse
- |> expect:is_error
-
- "1.23"
- |> int:parse
- |> expect:is_error
-}
-
-pub fn to_base_string() {
- 100
- |> int:to_base_string(_, 16)
- |> expect:equal(_, "64")
-
- -100
- |> int:to_base_string(_, 16)
- |> expect:equal(_, "-64")
-}
-
-pub fn compare_test() {
- int:compare(0, 0)
- |> expect:equal(_, order:Eq)
-
- int:compare(1, 1)
- |> expect:equal(_, order:Eq)
-
- int:compare(0, 1)
- |> expect:equal(_, order:Lt)
-
- int:compare(-2, -1)
- |> expect:equal(_, order:Lt)
-
- int:compare(2, 1)
- |> expect:equal(_, order:Gt)
-
- int:compare(-1, -2)
- |> expect:equal(_, order:Gt)
-}